[英]Microsoft.Web.Administration (for IIS7 automation) doesn't work in VS 2010
I'm trying to experiment with Microsoft.Web.Administration on my Windows 7 x64 box, using Visual Studio 2010. When I add the DLL to references in my C# project, I can see its namespaces and classes pop up in Intellisense. 我正在尝试使用Visual Studio 2010在我的Windows 7 x64盒子上试验Microsoft.Web.Administration。当我将DLL添加到我的C#项目中的引用时,我可以看到它的名称空间和类在Intellisense中弹出。
But as soon as I build, I get "The type or namespace name 'Web' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)", and I get build errors in the code I've written, as if the DLLs aren't even there. 但是一旦我构建,我得到“类型或命名空间名称'Web'在命名空间'Microsoft'中不存在(你是否缺少程序集引用?)”,我在编写的代码中遇到构建错误,就好像DLL甚至不存在一样。
There are two sets of IIS7 DLLs that I can see, in: 我可以看到有两组IIS7 DLL:
But both sets seem to do the same thing: Apparently initially work, then fail on build. 但两套似乎都做了同样的事情:显然最初工作,然后失败的构建。
Does anyone know what I need to do to get this working? 有谁知道我需要做些什么来使这个工作?
If this is a .NET 3.5 or .NET 4.0 project, open the project properties. 如果这是.NET 3.5或.NET 4.0项目,请打开项目属性。 On the Application tab it will have probably defaulted to either of:
在“应用程序”选项卡上,它可能默认为以下任一项:
Change this to .NET Framework 3.5 or .NET Framework 4. Your project should then build just fine. 将其更改为.NET Framework 3.5或.NET Framework 4.然后,您的项目应该正常构建。
As the compiler error points out, Microsoft.Web.Administration
has a dependency on System.Web
which isn't referenced in the 3.5/4.0 client profiles. 正如编译器错误所指出的那样,
Microsoft.Web.Administration
对System.Web
有依赖性,而在3.5 / 4.0客户端配置文件中没有引用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.