type intitializer error in C# module
Hello,
I have a C# application created using VS 2008 , then those DLLs areimported to another application created using VS 2005. There were no build errors at all for all the application module.When I created an installer & distributed to non-development m/c's I got an error message saying "Error: the type initializer for <module> threw an exception" the module it points to is a C# DLL.
Please let me know what care I should take to work it properly?
Re: type intitializer error in C# module
Is .NET framework is present on the non-development PC?
Re: type intitializer error in C# module
Yes,all required .NEt frameworks are present on Development & QA m/c's
Re: type intitializer error in C# module
Are all dependant DLLs present there ? i.e. the DLLs that you imported.
Re: type intitializer error in C# module
Yes,All the DLL's are present .our development m/c has .Net framework 3.5 SP1 & QA m/c has .NET framework SP2 .is this anyway responsible for the issue?
Re: type intitializer error in C# module
This error is only seen when some of the DLLs are not passed on to machine where you are trying to run the app. So check again and make sure that these dlls are there.
Re: type intitializer error in C# module
I checked availability of DLL's as well, all the required DLL'd are present still facing same issue.Kindly advice on the ways to troubleshoot this issue.
Re: type intitializer error in C# module
You need to use a tool like process explorer to see loaded DLLs on the source comp and then see on target comp for the application that you are running.
Re: type intitializer error in C# module
Quote:
Originally Posted by
forstudy3
Hello,
I have a C# application created using VS 2008 , then those DLLs areimported to another application created using VS 2005. There were no build errors at all for all the application module.When I created an installer & distributed to non-development m/c's I got an error message saying "Error: the type initializer for <module> threw an exception" the module it points to is a C# DLL.
Please let me know what care I should take to work it properly?
Do you know the missing C# dll? Is it a VS2008 dll or a VS2005 dll? Can you spot it both on the developer and target machine?
In case it is VS2008 dll it might use types that were not available (or not right version) on the target system. You then would need to install VS2008 redistributables to the target system.
Regards, Alex