Sign in to follow this  

[.net] TypeInitializationException

Recommended Posts

Hello, I have created a simple C# program. Everything was working fine while creating this project. But after I deployed my project (using ClickOnce) and tried to install and to run it, I get TypeInitializationException. Here is the information of the thrown exception: System.TypeInitializationException was unhandled Message="The type initializer for 'Visata.Program' threw an exception." Source="Visata" TypeName="Visata.Program" StackTrace: at Visata.Program.Main() at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel) at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData) at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() Why does this happen and how to solve it? Thanks in advance.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this