C:\Windows\Microsoft.NET\Frame ... [英] C:\Windows\Microsoft.NET\Frame...

查看:126
本文介绍了C:\Windows\Microsoft.NET\Frame ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:

VS2010和.Net 3.5(已安装SP1和VS2008)



我有3个小项目的解决方案;

1.vcxproj(输出:1.lib) - 非托管C ++代码(平台工具集:v100,框架:v3.5)

2.vcxproj(输入:1.lib) &output:2.dll) - 托管C ++代码(平台工具集:v100)

3.csproj(输入:2.dll&output:3.dll)(框架:v3.5)



前2个项目编译成功但是当我们编译3.csproj时,我们收到了警告;



C:\ Windows \ microsoft.NET \ Framework\v4.0.30319\Microsoft.Common.Targets(1578,5):警告MSB3258:主要参考F:\Test \ Proj2 \\\。 dll无法解析,因为它对.NET Framework程序集具有间接依赖性mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089其版本4.0.0.0高于版本2.0当前目标框架中的.0.0。 [f:\Test \ Proj3 \\\ csproj]



C:\ Windows \ Mysprosoft.NET \ Framework \v4.0.30319 \\ \\ Microsoft.Common.Targets(1578,5):警告MSB3258:无法解析主要引用F:\Test \ Proj2 \\\ .2.dll,因为它与.NET Framework程序集间接依赖 Microsoft.VisualC,Version = 10.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a其当前目标框架中的版本8.0.0.0高于8.0.0.0。 [f:\ Test \ Proj3 \3.csproj]



我已经尝试过互联网上的建议,但它们无法正常工作。你知道我的问题是什么吗?



提前致谢。



补充信息 - 在GAC,我看到了这些;



F:\bin> gacutil / l mscorlib

Microsoft(R).NET全局程序集缓存实用程序。版本4.0.30319.1

版权所有(c)Microsoft Corporation。保留所有权利。



全局程序集缓存包含以下程序集:

mscorlib,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089,processorArchitecture = AMD64

mscorlib,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089,processorArchitecture = x86

mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089,processorArchitecture = AMD64

mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089,processorArchitecture = x86



商品数量= 4



========================== ==========

F:\bin> gacutil / l Microsoft.VisualC

Microsoft(R).NET全局程序集缓存实用程序。版本4.0.30319.1

版权所有(c)Microsoft Corporation。保留所有权利。



全局程序集缓存包含以下程序集:

Microsoft.VisualC,Version = 8.0.0.0,Culture = neutral ,PublicKeyToken = b03f5f7f11d50a3a,processorArchitecture = MSIL

Microsoft.VisualC,Version = 10.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a,processorArchitecture = MSIL



项目数= 2

Environment:
VS2010 and .Net 3.5 (SP1 installed and VS2008)

I have a solution with 3 small projects;
1.vcxproj (output: 1.lib) - unmanaged C++ code (platform toolset: v100, framework: v3.5)
2.vcxproj (input: 1.lib & output: 2.dll) - managed C++ code (platform toolset: v100)
3.csproj (input: 2.dll & output: 3.dll) (framework: v3.5)

The first 2 projects were compiled successfully but when we compile 3.csproj, we received a warning;

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1578,5): warning MSB3258: The primary reference "F:\Test\Proj2\2.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version"2.0.0.0" in the current target framework. [f:\Test\Proj3\3.csproj]

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1578,5): warning MSB3258: The primary reference "F:\Test\Proj2\2.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "Microsoft.VisualC, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which has a higher version "10.0.0.0" than the version "8.0.0.0" in the current target framework. [f:\Test\Proj3\3.csproj]

I have tried the suggestions from the internet but they are not working. Would you know what my problem is?

Thanks in advance.

Additional information - in GAC, I see these;

F:\bin>gacutil /l mscorlib
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.

The Global Assembly Cache contains the following assemblies:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=AMD64
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=AMD64
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86

Number of items = 4

====================================
F:\bin>gacutil /l Microsoft.VisualC
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.

The Global Assembly Cache contains the following assemblies:
Microsoft.VisualC, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Microsoft.VisualC, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL

Number of items = 2

推荐答案

它告诉你你的Proj2是针对.NET 4.0或.NET 4.5编写的,而你正在尝试使用它。 .NET 3.5项目中的DLL。



.NET 4.0和4.5都使用.NET 4.0公共语言运行时。 .NET 2.0,3.0和3.5都使用.NET 2.0 CLR。​​



您不能在同一进程中混合使用不同的CLR版本。重新定位您的Proj2项目以针对.NET 3.5进行编译,您将不会收到此警告。
It's telling you that your Proj2 was written against .NET 4.0 or .NET 4.5 and you're trying to use that .DLL in a .NET 3.5 project.

.NET 4.0 and 4.5 both use the .NET 4.0 Common Language Runtime. .NET 2.0, 3.0 and 3.5 all use the .NET 2.0 CLR.

You cannot mix different CLR versions in the same process. Retarget your Proj2 project to compile against .NET 3.5 and you won't get this warning.


这篇关于C:\Windows\Microsoft.NET\Frame ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆