简体   繁体   English

System.ServiceModel消失

[英]System.ServiceModel disappear

After installing .Net Framework 4.0 it seems like I cannot find System.ServiceModel in .Net tab through "Add Reference..." by using VS2008. 安装.Net Framework 4.0之后,似乎无法通过VS2008通过“添加引用...”在.Net选项卡中找到System.ServiceModel。 But you can see it and add it in VS2010 version. 但是您可以看到它并将其添加到VS2010版本中。

Can someone tell me why, and how I can have both version, and still can use it in VS2008? 有人可以告诉我为什么,以及如何拥有这两个版本,并且仍然可以在VS2008中使用它吗?

Thanks 谢谢

If you go to the Visual Studio 2008 or 2010 command prompt (usually under All Programs - Visual Studio 20XX - Visual Studio Tools) and type in: 如果转到Visual Studio 2008或2010命令提示符(通常在“所有程序”-“ Visual Studio 20XX”-“ Visual Studio Tools”下)并键入:

gacutil /l System.ServiceModel gacutil / l System.ServiceModel

What do you get back? 你还得到什么?

If you have VS2008 & VS2010 installed, you should see two items listed (from my Win7 machine that has VS2008 & VS2010 installed): 如果安装了VS2008和VS2010,则应该看到列出的两项(从安装了VS2008和VS2010的Win7计算机中):

The Global Assembly Cache contains the following assemblies: 全局程序集缓存包含以下程序集:
System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL System.ServiceModel,版本= 3.0.0.0,区域性=中性,PublicKeyToken = b77a5c561934e089,processorArchitecture = MSIL
System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL System.ServiceModel,版本= 4.0.0.0,区域性=中性,PublicKeyToken = b77a5c561934e089,processorArchitecture = MSIL

Number of items = 2 项目数= 2

You should also see if you have System.ServiceModel.dll in C:\\Program Files\\Reference Assemblies\\Microsoft\\Framework\\v3.0 (from ChrisF's comment above). 您还应该查看C:\\Program Files\\Reference Assemblies\\Microsoft\\Framework\\v3.0是否有System.ServiceModel.dll(来自ChrisF的上述评论)。 The GAC should be referencing the assembly from there. GAC应该从那里引用程序集。 If you have the DLL there, but don't see it in the GAC, you can add it as a reference from the Add Reference dialog just by browsing to it. 如果您有DLL,但在GAC中看不到它,则可以通过浏览到它来从“添加引用”对话框中将其添加为引用。

Let me know what you see. 让我知道你所看到的。 I'll try to get back ASAP. 我会尽快回去。 Hope this helps. 希望这可以帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM