473,657 Members | 2,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

app.exe.config and unmanaged code

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\Michae l Kelley\Local
Settings\Applic ation Data
\edTesteditor.e xe_Url_uvu2olsp zeirw25ckveiedb klpgmqaz5\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\edEdi tor\edTerrain
\Win32_Debug_ed Testeditor\edTe steditor.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.
---------------------------
OK
---------------------------

Jun 20 '07 #1
1 3251
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/lib...a0(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 ConfigurationMa nager in the .Net 2.0 Framework or
ConfigurationSe ttings, 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
Jun 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7752
by: José Joye | last post by:
Hello, I have an assembly that is used by a VB6 application. This application can be a normal exe or an ActiveX (called through CCW). My assembly needs to get extra info from a config file. In order to hide it from the VB client, I want to link the config file to my assembly and not to the applicaction. In that sense, the config file will be called <myAssemblyName>.dll.config and will be located in the same directory as my assembly dll.
1
529
by: Kevin Lewis | last post by:
Is there .NET framework code that I can call from an assembly (.dll), that will load the settings of a configuration file into the .NET framework. For example you can set up Switches and TraceListeners through config settings such as: <system.diagnostics> <switches> <add name="MySwitch" value="31" /> </switches> <trace>
6
3631
by: Vai2000 | last post by:
Hi All, I have created a COM+ Component Foo.dll, I was wondering where I can store its Config File and what should I name it? this COM+ Component calls a WebSvc too! the IDE Created an app.config for me in the project workspace but somehow that isn't working.... TIA
1
1644
by: Sparhawk | last post by:
Hi, my company is going to migrate a large VC++ application to .NET to make use of Windows Forms (the old class library is not updated any more). We are not planning to migrate the rest of the code which works well. I understand the basic concept: our code is unmanaged, Windows Forms is Managed and Unmanaged may not call Managed code. I read about Wrappers, PInvoke, Runtime Callable Wrappers for COM and about It just
2
4172
by: Joseph Geretz | last post by:
Help me understand this, please. I have a Winforms app, lets call it WinApp.exe. I also have a DLL, lets call it WebBroker.dll. The purpose of WebBroker.dll is to broker an interface with a WebService. I don't encode this directly into MyWinApp, because I want to generate a single component which will be able to broker interface to the Web service for both .NET and VB6 apps. Naturally, I want WebBroker to use dynamic url reference....
1
1497
by: Anthony Yott | last post by:
Folks this may take a little while to explain but here goes. I've got a VS 2005 .NET C# library (lets call it Elvis.dll because I'm sick of seeing Foo) that I created that will be consumed by unmanaged C++ and VB6 clients. ComVisible is set to true at the Assembly level and the component is in the GAC and I used regasm to generate the type library. The .NET library uses a config file called lets say Elvis.config I access this file is...
3
3651
by: Andrew | last post by:
I have a class library that has app.config that has <system.diagnostics> that specifies trace listeners. The class library is loaded by a third party unmanaged application. I want the .NET framework to read the diagnostic section and create listeners for me. For a managed executable, this is done automatically, but not for a class library. What's the easiest way to have ..NET read and create the listeners, without me having to manually...
0
1254
by: Fainster | last post by:
Hi I have written a c# class library which consumes other .net assemblies (this is called from an unmanaged c++ app). All worked well until the assemblies I consume have been upgraded (existing dll's replaced). Although i use an application .config file (theapp.exe.config), the code still attempts to load previous versions of the dll's. Here's a sample of the file: <dependentAssembly> <assemblyIdentity name="LoginProcesses"...
0
963
by: iprogram2008 | last post by:
I have a huge complex app.config and one of the sections in the config is connection strings. I have a dot net class that uses this app.config and a com interop is generated for this dot net class. I developed an unmanaged c++ app and it calls the com interop tlb. The problem I was getting was when I call from C++ the tlb I get an null reference exception at the following line in .NetClass: ...
0
8718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8601
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5630
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.