rodnower
rodnower

Reputation: 1405

DragDrop registration did not succeed in Setup Project

We have some installation project in Visual Studio solution (Other project types -> Setup and deployment -> Setup project). This project has another library type project with Installation class named InstallationCore like project output. In user action, I call to Install and Uninstall functions of installer of InstallationCore.

InstallationCore has windows forms for interaction with user. There, in forms, I use Drag and Drop functionality for Drag and Drop text from Tree View to Text Box.
But in line:

txbUserName.AllowDrop = true;

I get error of JIT debugger:

Unhandled exception has occured
DragDrop registration did not succeed
System.InvalidOperationException: DragDrop registration did not succeed

And long stack trace after that.
Important to say, that when I run Installer function from test project the error did not occur and all work fine. Error occurs only when I run the .msi package.

Any suggestions?

Upvotes: 33

Views: 4169

Answers (5)

Abhinay
Abhinay

Reputation: 635

I fixed this problem by deleting my bin directory.

Upvotes: 1

Eddy Jawed
Eddy Jawed

Reputation: 457

Do you have any multi threads causing this issue. If so, find them and force them to STA

trd = New Threading.Thread(AddressOf ThreadTask) 
trd.IsBackground = True
trd.SetApartmentState(ApartmentState.STA)

Upvotes: 1

Kaushal B
Kaushal B

Reputation: 46

Build :- to build files and it replace or overwirtes all files whether they are present in bin folder or not.

Re-Build:- Use existing file if there is no modification.

Clean :- It deletes all files from the bin location.

Recommended is Clean and then Build, if you do not need the references and build related files else always use re-build.

Apart from this, in RUN, (Windows button + R), go to Temporary Folder (Type in %temp% in RUN) there is a folder related to .NET Temporary files, try deleting that if not able to delete it then close Visual Studio and then try deleting it. This is created every time we build or re-build the application and it sometimes create problems .

Upvotes: 0

Neeraj
Neeraj

Reputation: 4489

Please delete all your Obj folder from your solution directory and Rebuild solution. Remember not Build only Rebuild. Because Build is only prepare new changes in last successful build.So please use Re-Build option.

Upvotes: 0

Alex
Alex

Reputation: 910

Please try to clean the BIN directory.

Upvotes: 0

Related Questions