Microsoft.Web.Administration (for IIS7 automation) does not work in VS 2010

I am trying to experiment with Microsoft.Web.Administration in my Windows 7 x64 window using Visual Studio 2010. When I add DLLs to links in my C # project, I see that its namespaces and classes appear in Intellisense.

But as soon as I build, I get "The type or name of the namespace" Web "does not exist in the namespace" Microsoft "(do you miss the assembly reference?)", And I get assembly errors in the code I'm written as if DLLs were not even there.

There are two sets of IIS7 DLL files that I can see in:

  • % WINDIR% \ system32 \ Inetsrv
  • % Windir% \ syswow64 \ Inetsrv

But both sets seem to do the same thing: obviously, they initially work, and then fail.

Does anyone know what I need to do to make this work?

+3
source share
1 answer

If it is a .NET 3.5 or .NET 4.0 project, open the project properties. On the Application tab, it will probably default to:

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

Change it to .NET Framework 3.5 or .NET Framework 4. Then your project should be just fine.

As the compiler error indicates, it Microsoft.Web.Administrationhas a dependency System.Webon which client profiles 3.5 / 4.0 do not reference.

+6
source

Source: https://habr.com/ru/post/1784843/


All Articles