开发者

Microsoft.Web.Administration (for IIS7 automation) doesn't work in VS 2010

开发者 https://www.devze.com 2023-02-03 13:19 出处:网络
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 po

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.

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.

There are two sets of IIS7 DLLs that I can see, in:

  • %windir%\system32\inetsrv
  • %windir%\syswow64\inetsrv

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. On the Application tab it will have probably defaulted to either of:

  • .NET Framework 3.5 Client Profile
  • .NET Framework 4 Client Profile

Change this to .NET Framework 3.5 or .NET Framework 4. Your project should then build just fine.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消