c# - Does sku attribute in app.config determines against which framework the application is running?
问题描述
I have multiple frameworks installed on my machine.I have .NET Framework 4.6.1 and .NET Framework 4.8
If i build my application say with .NET Framework 4.6.1 and want to run it against 4.8. How do i do it?
Will adding the following tags in the App.config file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
make sure that the application is run against 4.8? Even though 4.6.1 still exits on the machine. If so how do i determine that my application has run against 4.8?
解决方案
如果您想使用另一个 .net 框架版本运行应用程序,您可以尝试以下两种方法来修改您的 .net 框架版本。
首先,请右键单击您的项目属性-> 选择 .NET Framework 4.8-> 重建项目。
其次,请在文件资源管理器中右键单击您的项目打开文件夹-> 打开 .csproj 文件。
尝试改变:
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
至
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
保存.csproj文件后,visual studio会弹出提示框,请选择reload all,即可修改成功。
推荐阅读
- python - 无法使用 Selenium-Python 上传存储在我的 Windows 机器上的文件
- android - 如何防止 NavController 导航到另一个片段(例如取消导航)
- rust - 给定Rust中的基数,如何将字符串转换为整数?
- javascript - 如何仅在开发环境中使用 proxyAgent
- vb.net - 多项目可选安装 MSI
- javascript - indexOf 不通过比较并返回 -1
- python - 如何使用 Cerberus 返回自定义规则名称/错误代码?
- excel - 加快 VBA 中的复制和粘贴
- unity3d - unity light bake - 如何管理混合光照
- python - Scapy 模块:netif = rt[4 + mtu_present + prio_present + refs_present + locked] IndexError:列表索引超出范围