directedition
directedition

Reputation: 11705

Apps only works when Visual Studio is installed?

I have a DLL put together which is used by a number of applications. They compile and run just fine on my development machine. But if I try to deploy them, I just get the standard "your application has crashed" message from Windows when I try to run them. I figured, since they're .NET, I could install Visual Studio and see what the exception is. But once I install Visual Studio, everything works fine! I've tried to identify anything (like certain versions of the .NET framework) that VS installs and try to replicate it, but still nothing will work till visual studio itself is installed. I certainly can't require people to install visual studio to use my app. What can I do?

Upvotes: 1

Views: 1728

Answers (6)

Kristian Damian
Kristian Damian

Reputation: 1356

In your deploy machine must install the Microsoft Visual C++ Redistributable Package

Upvotes: 0

Hans Passant
Hans Passant

Reputation: 941744

This is most likely a DLL that has a dependency on the C Runtime Library (CRT). You need to make sure to deploy the Release build of the DLL, the debug version of the CRT libraries cannot be distributed. If you compiled with the /MD option, you will also need to deploy the CRT DLLs to the target machine. Compiling with /MT avoids that but this option is not available if you use managed code in your DLL.

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1501163

If you reference the DLL from a console app, it should dump a stack trace to the console when it crashes... that may help.

Also, try enabling the Fusion log to help debug issues with finding references.

Upvotes: 6

JeffH
JeffH

Reputation: 10482

It sounds like you may not be delivering a required assembly during deployment. Use a tool like .Net Reflector to see.
The accepted answer on another question gives specific instructions.

Upvotes: 0

Bobby
Bobby

Reputation: 11576

Try installing the .NET Framework on the target machines.

Upvotes: 0

SLaks
SLaks

Reputation: 887547

Add a try / catch block to the program that displays or emails the exception.

Also, make sure that the correct version of .Net is installed.

Finally, go through your referenced DLLs and make sure that they all exist.

Upvotes: 0

Related Questions