只需要分发一份.exe文件,和.exe.config 文件打包到一起即可
只需要分发一份.exe文件,和.exe.config 文件打包到一起即可
https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/version-compatibility#Apps
By default, an app runs on the version of .NET Framework that it was built for. If that version isn't present and the app configuration file doesn't define supported versions, a .NET Framework initialization error may occur. In this case, the attempt to run the app will fail.
To define the specific versions on which your app runs, add one or more <supportedRuntime> elements to your app's configuration file. Each <supportedRuntime> element lists a supported version of the runtime, with the first specifying the most preferred version and the last specifying the least preferred version.
对于你的程序:
<configuration>
<startup>
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727" />
</startup>
</configuration>
这个我是清楚的,我怕某些用户不清楚,比如直接压缩包内运行等操作,所以没这样做