0

I am working on an application which is in C# and runs fine on my OS with Visual Studio installed.
If i take the executable to any other OSes,It crashes upon executing.
How can i know what exactly is missing so that i can solve the issue?
To be more precise on this case,I have used some Telerik components and i noticed there are already several Dlls pertaining to it next to the executable file.
I also installed Crystal Report for Visual Studio 2010 since there were reports in the project(in CR 2008),though i haven't used them so far.(I also tried installing

SAP_Crystal_Reports_runtime_engine_for_.NET_Framework_4_32bit

And

CRforVS_redist_install_32bit_13_0_1

On these systems which the application fails.But again no luck.

If I could know what exactly is missing I could know what I am dealing with and go straight forward to it and solve the issue

Hossein
  • 24,202
  • 35
  • 119
  • 224
  • What error message did you get? Have you added any error handling to your program? – Mark Byers Sep 16 '12 at 17:23
  • Catch the exception and display it. – SLaks Sep 16 '12 at 17:25
  • I have placed an exception in my Program.cs ,But it seems it happens prior to executing the application itself(I mean first line of code ).I need to restart to write down the error.I'll be updating the post. – Hossein Sep 16 '12 at 17:37

4 Answers4

3

One option is to use the Fusion log viewer to see assembly binding information on the target machine. Any assembly binding failures will be logged and you can see which assemblies are failing to load, and where the runtime is looking for them.

Lee
  • 142,018
  • 20
  • 234
  • 287
1

Have a look through your list of references. Anything that isn't standard in the framework, set the property of the reference to copy the assembly to the build directory.]

Also, make sure you're building for the correct processor architecture in your project properties.

caesay
  • 16,932
  • 15
  • 95
  • 160
  • Thank you,I need to restart the system annd test it on my other OS.I'll report back if it solved the problem. – Hossein Sep 16 '12 at 17:35
1

Check target machine's event log. There might be some dependencies missing. refer Dependecies. If it is crashing due to exception in application catch that in application exception event.

Community
  • 1
  • 1
Typist
  • 1,464
  • 9
  • 14
1

I think you can use AssemblyResolve event for this

AppDomain.CurrentDomain.AssemblyResolve += (object sender, ResolveEventArgs args)=>
    {
        string assemblyToResove = args.Name;
        //return Assembly.Load(....);
    };
L.B
  • 114,136
  • 19
  • 178
  • 224