cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
COSMED
Level 4

Custom Action doesn't work

Hello,

I'm trying to create a setup for a Visual Studio Project.

In this setup I must:
1) create a folder if it isn't exist
2) execute sql script that create a database saved in the folder created at point1.

My problem is at point1. I use Custom Action and I create "New Managed Code" (Stored In Binary Table) to call a c# dll (CreateFolder.dll).

This dll utilize the following method:
public void CheckFolder()
{
string path = "C:\\Db";
if (!Directory.Exists(path))

Directory.CreateDirectory(path);
}

I set my Custom Action as follows:
- Assembly file: \CreateFolder.dll
- Method Signature: CreateFolder.Class1.CheckFolder()
- Install UI Sequence and Install Exec Sequence:

I build the setup but when I run it an error occurred. This is error 2731: Selection Manager not inizialized.

What's going on? What's wrong?
Labels (1)
0 Kudos

(2) Replies
SMadden
Level 6

Hi,

If you only need to create a folder, I'd use a standard action for that instead of a custom action. There is the CreateFolder table that you can use.

If you need to do other stuff as well in your custom action and don't want to use the CreateFolder table, sequence the CA after the file costing actions. E.g CostFinalize. That should get rid of the error message.

Sandra
0 Kudos
COSMED
Level 4

Thank you very much Sandra!
0 Kudos