I have a C# application MyApp.exe that targets .NET 3.5. In order to support other versions, I used MSDN instructions, and created a config file MyApp.exe.config, with the following content:

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0"/>
    <supportedRuntime version="v2.0.50727"/>
  </startup>
</configuration>

My question is what should I do with this file? Do I need to include it in the installer and put near the exe file on the target computer? I couldn't find any instructions about it.

有帮助吗?

解决方案

Do I need to include it in the installer and put near the exe file on the target computer?

Yes. This file needs to exist next to the installed exe post-deployment.

Most installers that understand .NET deployment will automatically handle this for you, so it's likely you won't need to "do" anything special (other than verify it got copied across correctly.)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top