.NET - Can App.Config Be Embedded?

According to this: https://msdn.microsoft.com/en-us/library/jj152935%28v=vs.110%29.aspx

For the .NET Framework 4 / 4.5 to work with .NET 2.0 applications, the app.config file must be provided.

I want to maximize the compatibility of my .NET 2.0 applications.

I need it to work with PCs that have .NET 2.0 installed or .NET 4 installed.

The problem is that having the app.config application always with the executable is not as professional as we would like it to look.

My application is a standalone application, so having an app.config application to run it does not make it standalone.

These are settings inside app.config, you see that my settings do not match my runtime settings.

<configuration> <startup> <supportedRuntime version="<version>"/> </startup> </configuration> 

The application will start without the .config application in the .NET 2.0 environment, but if in the .NET 4.0 environment the app.config application is required.

Is there any fix for this?

Thanks for reading.

Edit:

My question is different from: How to compile my App.config in my exe in VS2010 C # console application?

Since this concerns the settings of the .NET runtime, and not the application settings.

+7
source share
1 answer

One .exe will not be very professional, you can take a look at some alternatives such as ClickOnce

Some key features make the upgrade process easier and more efficient, for example, the Windows GitHub client is delivered using ClickOnce.

There are many other alternatives for delivering your application, such as Wix

However, it is also possible to embed resources in the dll, for example, see here . But, like marc_s , embedding app.config doesn't make much sense.

Hope this helps.

+1
source share

All Articles