在VS 2010中使用microsoft.web.administration dll时出现问题 [英] Problem using microsoft.web.administration dll with VS 2010

查看:245
本文介绍了在VS 2010中使用microsoft.web.administration dll时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在C#和VS 2010中使用适用于IIS7的新托管配置API。 它需要添加对Microsoft.Web.Administration的引用。  我没有在.NET或COM引用下找到它,所以我得到了一个dll的副本并直接引用它
。 一旦我添加了引用,Visual Studio将按预期解析诸如ServerManager,SiteCollection等类型,intellisense工作,我可以在对象浏览器中浏览命名空间。 但是,当我尝试构建项目时,
我收到错误消息:


错误    2   命名空间"Microsoft"中不存在类型或命名空间名称"Web"(您是否缺少程序集引用?)  


此外,ServerManager等类型突然获得尽管Microsoft.Web.Administration仍然在引用部分中,但红色下划线意味着它无法再解析它们。 当发生这种情况时,命名空间也会从对象浏览器中消失


我可以删除并再次添加引用,之后它将再次成功解析(并且它将显示在对象浏览器)但是一旦我尝试构建项目,它们就会停止解析。


我也尝试将dll的特定版本属性从false更改为true但这对任何一个都无济于事。


 


请注意,我正在开发应用的桌面有IIS 6. 我从运行IIS 7的不同服务器获取了dll并将其复制到我的本地计算机。我的目的是使用该应用程序远程连接到运行IIS 7的服务器,因此如果我可以在本地连接,它对我来说不重要。


这会带来一个额外的问题如果您使用OpenRemote方法并且不想以登录用户身份进行连接,那么我有哪些方法可以提供凭据。

解决方案

  ;


 


http://forums.iis.net 致力于IIS和相关技术,您可以考虑将其发布在那里以获得更好的响应。


I'm trying to use the new Managed Configuration API for IIS7 in C# with VS 2010.  It requires adding a reference to Microsoft.Web.Administration.   I didn't find it under .NET or COM references so I got a copy of the dll and referenced it directly.  Once I add the reference, types such as ServerManager, SiteCollection etc. are resolved by Visual Studio as expected, intellisense works and I can browse the namespace in the object browser.  However as soon as I try to build the project, I get an error saying:

Error    2    The type or namespace name 'Web' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)  

and additionally, types such as ServerManager suddenly get the red underline meaning it can no longer resolve them despite the fact that Microsoft.Web.Administration is still in the references section.  When this happens the namespace also disappears from the object browser.

I can remove and add the reference again after which it will again resolve successfully (and it will show up in the object browser) but as soon as I try building the project they will stop resolving.

I also tried changing the Specific Version property for the dll from false to true but this didn't help either.

 

Note that the desktop where I am developing the app has IIS 6.  I got the dll from a different server running IIS 7 and copied it to my local machine. My intention is to use the application to remotely connect to servers running IIS 7 so it doesn't matter to me if I can connect locally.

This brings up an additional question I have which is how you can provide credentials if you use the OpenRemote method and don't want to connect as the logged on user.

解决方案

 

Hi,

 

http://forums.iis.net where IIS experts live in, is dedicated to IIS and related technologies, you may consider posting it there for better responses.


这篇关于在VS 2010中使用microsoft.web.administration dll时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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