App wont run when adding 'appSettings' to config file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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.


--
moondaddy@xxxxxxxxxxxxxxx


.



Relevant Pages

  • Re: [kde] Dolphin starts programs with a wrong current directory
    ... are in it in the CLI or a file manager shouldn't matter. ... to their own home dir might possibly have config and data in the same ... Data depends a bit more on the app as it's not quite as ... config for, it's near impossible to install as a system app, because then ...
    (KDE)
  • Re: [kde] Dolphin starts programs with a wrong current directory
    ... are in it in the CLI or a file manager shouldn't matter. ... to their own home dir might possibly have config and data in the same ... Data depends a bit more on the app as it's not quite as ... config for, it's near impossible to install as a system app, because then ...
    (KDE)
  • Re: Installing several instances of an app as services
    ... There would be one config file, ... and process to copy that database. ... > at the moment i am developing an app which is sort of an interface to copy ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: H323 gateway setting in TAPI3
    ... > gateway address via the GUI of netmeeting, ... > the H323 gateway settings and change to my own settings ... > Why not change the H323.TSP configuration to the settings you app requires? ... If two TAPI apps use different H323.TSP config, they will conflit, only one ...
    (microsoft.public.win32.programmer.tapi)
  • Re: H323 gateway setting in TAPI3
    ... > gateway address via the GUI of netmeeting, ... > the H323 gateway settings and change to my own settings ... > Why not change the H323.TSP configuration to the settings you app requires? ... If two TAPI apps use different H323.TSP config, they will conflit, only one ...
    (microsoft.public.internet.netmeeting)