app.exe.config and unmanaged code

M

Michael.A.Kelley

I have an unmanaged C++ application that is linked with managed C++
and C# libraries. In one of the C# libraries, I have a Settings
file. This seems to load and save just fine to and from the user
settings directory (C:\Documents and Settings\Michael Kelley\Local
Settings\Application Data
\edTesteditor.exe_Url_uvu2olspzeirw25ckveiedbklpgmqaz5\0.0.0.0). Now
I want to have a default file that is loaded if the settings don't
currently exist. After doing some research, it seemed that an
app.exe.config file would do the trick. I copied the user.config in
the user settings directory to the application directory thinking this
would automatically work, but that isn't the case - I get the message
below. Any ideas what I might be doing wrong?

---------------------------
Microsoft Visual Studio
---------------------------
Unable to start program 'c:\tree2\trunk\soft\src\edEditor\edTerrain
\Win32_Debug_edTesteditor\edTesteditor.exe'.



This application has failed to start because the application
configuration is incorrect. Review the manifest file for possible
errors. Reinstalling the application may fix this problem. For more
details, please see the application event log.
 
D

DArnold

Any ideas what I might be doing wrong?
You can't be copying some user.config file thinking it's going to
replace app.exe.config. An app.exe.config has XML elements in it that a
user.config will not have in it that the program needs, which is causing
your problems.

http://msdn2.microsoft.com/en-us/library/k4s6c3a0(VS.80).aspx

It seems to me that if you need some default settings in a user.config
file, because some other config file is not there, then you need to put
the default.config in place not replacing app.exe.config.

Maybe, you need to use ConfigurationManager in the .Net 2.0 Framework or
ConfigurationSettings, which is part of the Application Configuration
Block that can be implemented and used with .Net 1.1 Framework; if you
have control of the managed code, use Google and look them up
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top