M
moondaddy
I'm running a wpf windows app and want to add the appSettings element to the
config file. when I do, the app wont start up and I get the following
error:
{"The type initializer for 'System.Windows.Application' threw an
exception."}
{"The type initializer for 'System.Windows.Navigation.BaseUriHelper' threw
an exception."}
" at System.Windows.Application..ctor()\r\n at
DiagramTool_v1.App..ctor()\r\n at DiagramTool_v1.App.Main() in
D:\\nwis\\Apps\\WPF\\DiagramTool_v1\\DiagramTool_v1\\obj\\Debug\\App.g.cs:line
0\r\n at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)\r\n at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at
System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)\r\n at
System.Threading.ThreadHelper.ThreadStart()"
the app will run when the config file looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="some string...." />
</connectionStrings>
</configuration>
But not like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="RunFrom" value="Voyager" />
</appSettings>
<configSections>
</configSections>
<connectionStrings>
<add name="some string...." />
</connectionStrings>
</configuration>
Note: this DID work in a .net 1.1 app. Am I supposed to put the
appSettings element somewhere else now? Isnt there a tool I can use to
create config files through a windows UI?
Thanks.
config file. when I do, the app wont start up and I get the following
error:
{"The type initializer for 'System.Windows.Application' threw an
exception."}
{"The type initializer for 'System.Windows.Navigation.BaseUriHelper' threw
an exception."}
" at System.Windows.Application..ctor()\r\n at
DiagramTool_v1.App..ctor()\r\n at DiagramTool_v1.App.Main() in
D:\\nwis\\Apps\\WPF\\DiagramTool_v1\\DiagramTool_v1\\obj\\Debug\\App.g.cs:line
0\r\n at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)\r\n at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at
System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)\r\n at
System.Threading.ThreadHelper.ThreadStart()"
the app will run when the config file looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="some string...." />
</connectionStrings>
</configuration>
But not like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="RunFrom" value="Voyager" />
</appSettings>
<configSections>
</configSections>
<connectionStrings>
<add name="some string...." />
</connectionStrings>
</configuration>
Note: this DID work in a .net 1.1 app. Am I supposed to put the
appSettings element somewhere else now? Isnt there a tool I can use to
create config files through a windows UI?
Thanks.