如何引用Microsoft.Web.Administration? [英] How to reference Microsoft.Web.Administration?
问题描述
Microsoft.Web.Administration程序集位于我的计算机上的 C:\ WINDOW \ System32 \inetsrv
中。我相信它是作为IIS的一部分安装的。该程序集也在GAC中。
The Microsoft.Web.Administration assembly is found in C:\Windows\System32\inetsrv
on my machine. I believe it is installed as part of IIS. The assembly is also in the GAC.
我应该如何从项目中引用此程序集,因为我想将项目提交给SVN以供其他人签出。 Microsoft.Web.Administration
未出现在Visual Studio的添加引用列表中。我可以添加对 C:\ Windows \System32 \inetsrv\Microsoft.Web.Administration
的引用,但这似乎是一个坏主意,因为其他开发人员可能有它安装在不同的路径或驱动器上。
How should I reference this assembly from my project, given that I want to commit the project to SVN for others to checkout. Microsoft.Web.Administration
does not appear in the Visual Studio 'Add References' list. I can add a reference to C:\Windows\System32\inetsrv\Microsoft.Web.Administration
, but this seems like a bad idea as other developers might have it installed on a different path or drive.
或者我可以将它复制到项目文件夹中,但是我必须将二进制文件提交到SVN。
Or I could copy it into the project folder, but then I have to commit the binary to SVN.
推荐答案
以下步骤对我有用:
- 复制位于
C:\ Windows \ System32 \inetsrv
中的Microsoft.Web.Administration.dll
- 在
*。csproj
所在的文件夹中,添加文件夹/ lib
并将Microsoft.Web.Administration.dll
粘贴到/ lib
文件夹 - 现在在
*。csproj
中添加.dll的相对路径:打开* .csproj
,搜索对于标记< ItemGroup>
并添加以下xml定义:
- Copy the
Microsoft.Web.Administration.dll
located inC:\Windows\System32\inetsrv
- In the folder where your
*.csproj
is located, add the folder/lib
and paste theMicrosoft.Web.Administration.dll
into the/lib
folder - Now add the relative Path to the .dll in your
*.csproj
: Open*.csproj
, search for tag<ItemGroup>
and add the following xml-definition:
< Reference Include =Microsoft.Web.Administration,Version = 7.9.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35,processorArchitecture = MSIL>
< SpecificVersion> False< / SpecificVersion>
< HintPath> lib\Microsoft.Web.Administration.dll< / HintPath>
< / Reference>
最后,将/ lib添加到您的SVN仓库中。
在SVN结账后,每台机器都适用我。
At last, add the /lib into your SVN repo. That works for me on each machine after SVN checkout.
如果你错过 Microsoft.Web.Administration.dll
在 C:\ Windows \ system32 \inetsrv
中,在Windows功能中启用IIS管理控制台:
If you are missing the Microsoft.Web.Administration.dll
in C:\Windows\System32\inetsrv
, enable IIS Management Console in your Windows Features:
这篇关于如何引用Microsoft.Web.Administration?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!