According to this: https://msdn.microsoft.com/en-us/library/jj152935%28v=vs.110%29.aspx
In order for .NET Framework 4/4.5 to work with .NET 2.0 apps, an app.config must be provided.
I want to maximize the compatibility of my .NET 2.0 apps.
I need it to work with PCs that only have .NET 2.0 installed or .NET 4 installed.
The problem is that, having an app.config always present with the executable is not as professional as I want it to look like.
My App is a standalone app, so having an app.config to make it work does not really make it a standalone app.
This is the settings inside the app.config, you see it's not really my settings its a runtime version settings.
<configuration>
<startup>
<supportedRuntime version="<version>"/>
</startup>
</configuration>
The app will run without the app.config in .NET 2.0 framework, but if within .NET 4.0 framework the app.config is required.
Is there any fix for this?
Edit:
My question is different from: How do I compile my App.config into my exe in a VS2010 C# console app?
As this tackles .NET runtime-version settings, not the app's settings itself.
A typical location would be: C:\Windows\System32\inetsrv\ApplicationHost. config.
Now you might be wondering what happens behind the scenes. Well, when you compile your application, the compiler actually copies the app. config file to the output folder, but gives it another name: When you start your application (ConsoleApp1.exe in our example), the matching config file will be loaded too.
ASP.NET Core builds a single, key-value-based configuration object using settings from one or more configuration providers. App Configuration offers a . NET configuration provider library. Therefore, you can use App Configuration as an extra configuration source for your app.
Settings. settings is located in the My Project folder for Visual Basic projects and in the Properties folder for Visual C# projects. The Project Designer then searches for other settings files in the project's root folder. Therefore, you should put your custom settings file there.
A single .exe
will not be very professional, you can take a look at some alternatives like ClickOnce
Some of the key features are it make the update process much more simple, and efficient, for example the GitHub windows client is delivered using ClickOnce.
There plenty of other alternatives to deliver your application like Wix
However it also possible to embed resources in the dlls like take a look here. But as marc_s said embedding the app.config
does not make much sense.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With