简体   繁体   English

.net Dll转换为4.5.2后显示框架4.0

[英].net Dll shows framework 4.0 after being converted to 4.5.2

I've found a partial answer to my question in this thread: 我在此线程中找到了我的问题的部分答案:

Here on stackoverflow cannot change target framework... 在这里stackoverflow无法更改目标框架...

In my case, the framework has successfully been converted to 4.5.2, and putting a method with async and await, that I'm sure are part of framework 4.5, the method is successfully run by an exe referencing the library. 就我而言,该框架已成功转换为4.5.2,并放置了一个带有async和await的方法,我确定它是框架4.5的一部分,该方法由引用该库的exe成功运行。 So I can presume that the library is really compiled using framework 4.5.2. 因此,我可以假定该库实际上是使用框架4.5.2编译的。

However, when referenced in any other project the library shows in its properties that it is compiled under framework 4.0. 但是,当在任何其他项目中引用该库时,该库将在其属性中显示它是在框架4.0下编译的。 and when the debugger loads the assembly it prints out that it is compiled under framework 4.0... So who is right? 当调试器加载程序集时,它会打印出它是在Framework 4.0下编译的...那么谁是对的? my code executing methods of framework 4.5 or the strings telling the library is on framework 4.0? 我的框架4.5的代码执行方法或告诉库的字符串在框架4.0上?

I've checked for what possible in my abilities if there are any .targets files in my installation, and yes there are two, under the msbuild-targets temporary folder, Microsoft.Common.targets and Microsoft.Csharp.targets, but I'm not able to understand if these files force the compiler to use framework 4.0. 我已经检查了我的安装中是否有任何.targets文件,并且在msbuild-targets临时文件夹下有两个Microsoft.Common.targets和Microsoft.Csharp.targets,我有什么可能,但是我我无法理解这些文件是否迫使编译器使用框架4.0。 Mainly because on this machine I compile directly in visual studio. 主要是因为我在这台机器上直接在Visual Studio中进行编译。

I have several solutions using component libraries compiled 4.5.2 that work correctly. 我有几种使用组件库4.5.2正常工作的解决方案。 So I don't really know how to be sure that my library is compiled under the right framework and that the library shows the right framework in its properties and when loaded. 因此,我真的不知道如何确定我的库是在正确的框架下编译的,以及该库在其属性和加载时是否显示了正确的框架。

If anyone has a clue on how to achieve this, thank you in advance. 如果有人对如何实现这一目标有所了解,请先谢谢您。

If your project properties say you're targeting .NET 4.5.2, then it's being built to work with .NET 4.5.2 and above versions. 如果您的项目属性表明您的目标是.NET 4.5.2,则说明该版本可与.NET 4.5.2及更高版本一起使用。

Maybe you've a confusion with CLR and Framework versions. 也许您对CLR和Framework版本感到困惑。 .NET 4.x (any) work with CLR (ie Common Language Runtime ) 4.0. .NET 4.x(任何版本)可与CLR(即公共语言运行时 )4.0一起使用。

Check .NET Framework Versions and Dependencies to get further details about this topic. 检查.NET Framework版本和相关性以获取有关此主题的更多详细信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Entity Framework中从.net 4.5.2更改为4.0的版本问题 - Version issue with change from .net 4.5.2 to 4.0 in Entity Framework 使用sql server 2008中.net framework 4.0创建的dll创建CLR存储过程。显示错误 - Create CLR stored procedure using the dll created by .net framework 4.0 in sql server 2008. Is shows error .NET Framework升级后(.NET 4.0至.NET 4.5.1)的DLL冲突 - DLL's conflict after .NET framework upgrade (.NET 4.0 to .NET 4.5.1) .net从4.0升级到4.5.2后,如何使WCF在http和https中都能工作? - How to make WCF work in both http and https after upgrading .net to 4.5.2 from 4.0? 无法从 .NET 6 项目加载 .NET 框架 4.0 dll - Failed to load .NET framework 4.0 dll from .NET 6 project Visual Studio Express .net框架4.5.2 - Visual Studio Express .net framework 4.5.2 从 .NET Framework 2.0 迁移到 4.5.2 - Migration from .NET framework 2.0 to 4.5.2 在将net framework 4.5.2升级到4.7.1之后,构建错误“尝试加载具有不正确格式的程序集” - Build error “An attempt was made to load an assembly with an incorrect format ” after upgrade net framework 4.5.2 to 4.7.1 从 .NET Framework 4.5.2 升级到 4.8 后,带有 COM 初始化的 Windows 服务不再工作 - Windows service with COM initialization is not working any more after upgrading from .NET Framework 4.5.2 to 4.8 现在将.net Framework 3.5转换为4.0时,每当我尝试执行回发时,都会收到脚本错误 - Converted .net framework 3.5 to 4.0 now i get a scripting error whenever i try to do a postback
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM