problem using microsoft.web.administration with vs 2010 RRS feed

  • Question

  • You cannot vote on your own post

    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.

    • Moved by spacewrangler Tuesday, October 19, 2010 3:43 AM asp.net (From:Building Development and Diagnostic Tools for .Net)
    Thursday, October 14, 2010 7:12 PM

All replies

  • Hi,

    Thanks for your post, but you may consider asking the question at http://forums.asp.net/  for quicker and better support.

    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, October 18, 2010 12:52 AM
  • I had the same problem, and resolved it by changing the Properties for my application. In particular, I right clicked on the Properties node in the Solution Explorer, chose the Application page, and changed the client framework from .Net Framework 4.0 Client Profile to just plain .NET Framework 4.0.

    Monday, December 20, 2010 10:06 PM