Startup Error : System.TypeInitializationException
pshah
Posts: 3
I had upgraded to SQL Prompt 5.1 and worked ok, until I installed VS 2010 (which also installed SQL 2008). I am trying to open my SQL 2005 management studio and receiving an exception that prevents SQL Prompt add-in to be loaded. Please help!
On starting SQL 2005 studio I see : addin 5.1 failed to load.
Error number : 80131604
The exception in log file :
17 Jun 2011 13:49:00,071 [1] INFO RedGate.SqlPrompt.Engine.LogService - Starting new SQL Prompt editor session
17 Jun 2011 13:49:00,326 [1] ERROR RedGate.SqlPrompt.Engine.Options.OptionsBase - Error deserializing options for RedGate.SQLPrompt.CommonUI.Options.UIOptions. Resetting to defaults.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'RedGate.SQLPrompt.CommonUI.Options.SqlPromptApplication' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section system.serviceModel. (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 137)
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Net.Configuration.SettingsSectionInternal.get_Section()
at System.Net.Sockets.Socket.InitializeSockets()
at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
at System.Net.NetworkInformation.IpAddrString.ToIPAddressCollection()
at System.Net.NetworkInformation.SystemIPGlobalProperties.GetFixedInfo()
at System.Net.NetworkInformation.SystemNetworkInterface.PostWin2KGetNetworkInterfaces(AddressFamily family)
at System.Net.NetworkInformation.SystemNetworkInterface.GetNetworkInterfaces(AddressFamily family)
at System.Net.NetworkInformation.SystemNetworkInterface.InternalGetIsNetworkAvailable()
at System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()
at W.c()
at W.b()
at RedGate.Licensing.Client.Licence.a(String , Int32 , String , Int32 , Int32 , String , Int32 )
at RedGate.Licensing.Client.Licence.GetLicence(Int32 productCode, String productName, Int32 majorVersion, Int32 minorVersion, String location)
at RedGate.SQLPrompt.CommonUI.Options.SqlPromptApplication.?()
at RedGate.SQLPrompt.CommonUI.Options.SqlPromptApplication..cctor()
--- End of inner exception stack trace ---
at RedGate.SQLPrompt.CommonUI.Options.SqlPromptApplication.add_LicenseChanged(EventHandler value)
at RedGate.SQLPrompt.CommonUI.Options.UIOptions..ctor()
at OptionsClassd06a65c0195a4dbfbf64473d1a83c6b1..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.a(XmlReader , String , String )
at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.DeserializeRootObject(TextReader reader, String name, String typeName)
at RedGate.SqlPrompt.Engine.Options.OptionsBase.?(Type optionsType, TextReader reader)
at RedGate.SqlPrompt.Engine.Options.OptionsBase.?(Type optionsType)
at RedGate.SqlPrompt.Engine.Options.OptionsBase.LoadOptions[T]()
On starting SQL 2005 studio I see : addin 5.1 failed to load.
Error number : 80131604
The exception in log file :
17 Jun 2011 13:49:00,071 [1] INFO RedGate.SqlPrompt.Engine.LogService - Starting new SQL Prompt editor session
17 Jun 2011 13:49:00,326 [1] ERROR RedGate.SqlPrompt.Engine.Options.OptionsBase - Error deserializing options for RedGate.SQLPrompt.CommonUI.Options.UIOptions. Resetting to defaults.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'RedGate.SQLPrompt.CommonUI.Options.SqlPromptApplication' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section system.serviceModel. (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 137)
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Net.Configuration.SettingsSectionInternal.get_Section()
at System.Net.Sockets.Socket.InitializeSockets()
at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
at System.Net.NetworkInformation.IpAddrString.ToIPAddressCollection()
at System.Net.NetworkInformation.SystemIPGlobalProperties.GetFixedInfo()
at System.Net.NetworkInformation.SystemNetworkInterface.PostWin2KGetNetworkInterfaces(AddressFamily family)
at System.Net.NetworkInformation.SystemNetworkInterface.GetNetworkInterfaces(AddressFamily family)
at System.Net.NetworkInformation.SystemNetworkInterface.InternalGetIsNetworkAvailable()
at System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()
at W.c()
at W.b()
at RedGate.Licensing.Client.Licence.a(String , Int32 , String , Int32 , Int32 , String , Int32 )
at RedGate.Licensing.Client.Licence.GetLicence(Int32 productCode, String productName, Int32 majorVersion, Int32 minorVersion, String location)
at RedGate.SQLPrompt.CommonUI.Options.SqlPromptApplication.?()
at RedGate.SQLPrompt.CommonUI.Options.SqlPromptApplication..cctor()
--- End of inner exception stack trace ---
at RedGate.SQLPrompt.CommonUI.Options.SqlPromptApplication.add_LicenseChanged(EventHandler value)
at RedGate.SQLPrompt.CommonUI.Options.UIOptions..ctor()
at OptionsClassd06a65c0195a4dbfbf64473d1a83c6b1..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.a(XmlReader , String , String )
at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.DeserializeRootObject(TextReader reader, String name, String typeName)
at RedGate.SqlPrompt.Engine.Options.OptionsBase.?(Type optionsType, TextReader reader)
at RedGate.SqlPrompt.Engine.Options.OptionsBase.?(Type optionsType)
at RedGate.SqlPrompt.Engine.Options.OptionsBase.LoadOptions[T]()
Comments
Once you've updated machine.config, you'll definitely need to restart SSMS to see whether that fixes the problem. You may need to restart your machine to persuade the .NET framework to reload the machine.config, although that probably won't be necessary.
Please let us know whether this fixes your problem or not. If it doesn't, we can try to investigate further.
Kind Regards,
Mike Upton
Redgate Software
I just installed SmartAssembly trial version 6.6.0.0144 and built my first obfuscated project. The obfuscated version throws this error at startup (but the unobfuscated version is working normally). After the error, the application mostly works, although a web browser control on the main form does not. Interestingly, a web browser control on a modal dialog displayed later does work.
When I close the application it tries to report the error and fails with a red X next to the message, "Connecting to server. (ERR 2001: Configuration system failed to initialize)
I was able to save the error log to a file and view it that way. The top line of the Stack Trace says:
[System.Configuration]System.Configuration.ConfigurationErrorsException
Unrecognized configuration section userSettings.
(C:\Users\ianc\AppData\Local\icVisions_Corporation\Soteria.exe_<bunch of characters>1.0.0.26\user.config line 3)
I purchased a code signing certificate from Verisign and am awaiting delivery. Is the code signing certificate in any way related to strong key signing? I noticed that one of the settings in SmartAssembly said that I can not process my assembly with another tool or it would quit working. Is that something I have to turn off in order to use a code signing certificate? Are there any good help topics on code signing? I didn't see any when I searched.