How to reference a self made assembly that is installed in the GAC in visual studio?

后端 未结 3 1025
礼貌的吻别
礼貌的吻别 2021-01-07 05:04

I created a homemade assembly and I think I installed it correctly in the GAC using the .Net 2.0 configuration tool (mscorcfg.msu) However, when I want to reference it in vi

3条回答
  •  长情又很酷
    2021-01-07 05:43

    When you need to reference an assembly that has been deployed to the GAC, you will need to browse to the \bin\Debug directory of the original project via the Browse tab of the Add Reference dialog in Visual Studio.

    The reason this works is that since you've installed the assembly into the GAC, it will have a strong name and therefore a .publickey value in the manifest.

    When you reference an assembly whose manifest contains a .publickey value, Visual Studio assumes the strongly named assembly will most likely be deployed to the GAC, and therefore does not bother to copy the binary to your application folder.

    Instead, it will use the version in the GAC.

提交回复
热议问题