Visual Studio中的汇编缓存问题

时间:2022-03-02 03:52:23

I have a problem with assembly caching in visual studio. I want to alter the references I have with strongly names assemblies. So I signed the assemblies and they were signed successfully, but when I try to reference them in visual studio it seems that it still caches the old version! I can not find a way to delete the old ones, I even changed the version and VS is still unable to detect the new ones.

我在visual studio中遇到了程序集缓存的问题。我想用强名称程序集修改引用。因此,我对程序集进行了签名,并成功地进行了签名,但是当我尝试在visual studio中引用它们时,它似乎仍然缓存旧版本!我找不到删除旧版本的方法,我甚至修改了版本,VS仍然无法检测到新的版本。

any ideas?

什么好主意吗?

Thanks

谢谢

2 个解决方案

#1


1  

Check the properties of an added reference.

检查附加引用的属性。

Visual Studio中的汇编缓存问题

The Path property allows to find out where the old assembly is located and delete it. Please also pay attention to Copy Local property value. If it is false then the old assembly is resided at GAC and you should uninstall it from there.

Path属性允许查找旧程序集所在的位置并删除它。请注意复制当地的财产价值。如果是假的,那么旧的程序集就位于GAC,您应该从那里卸载它。

#2


0  

I think this is the same problem I was having. My solution is the following, which seems to work reliably (for me anyway, in Visual Studio 2015):

我想这和我遇到的问题是一样的。我的解决方案是:

  1. From the File menu, select Close Solution.
  2. 在“文件”菜单中,选择“关闭解决方案”。
  3. From the File menu, click Recent Projects and Solutions and reopen your solution.
  4. 在“文件”菜单中,单击“最近的项目和解决方案”并重新打开解决方案。
  5. Right click on a project in the Solution Explorer and select Unload Project. (I use a project at the tail end of my reference dependencies, something that doesn't depend on other projects, but on which most other projects depend.)
  6. 右键单击解决方案资源管理器中的项目并选择卸载项目。(我在参考依赖项的末尾使用了一个项目,它不依赖于其他项目,但大多数其他项目依赖于此。)
  7. Right click on the unloaded project and select Reload Project.
  8. 右键单击unloaded项目并选择Reload项目。

Et voila! your assembly references for all your projects should now point to the right assembly files. At least they should if your problem was similar to mine.

果不其然!您的所有项目的程序集引用现在应该指向正确的程序集文件。如果你的问题和我的相似,至少他们应该这么做。

In my case, assemblies were referenced via a $(PathToAssembly) MSBuild property, set in an MSBuild targets file included from my project file. When the value of the PathToAssembly property changed, the references were not updating, due to some internal cache in Visual Studio. The above incantation correctly updates the references.

在我的例子中,程序集是通过$(PathToAssembly) MSBuild属性进行引用的,该属性设置在我的项目文件中包含的MSBuild目标文件中。当PathToAssembly属性的值发生更改时,由于Visual Studio中的某些内部缓存,引用没有更新。上面的咒语正确地更新了引用。

#1


1  

Check the properties of an added reference.

检查附加引用的属性。

Visual Studio中的汇编缓存问题

The Path property allows to find out where the old assembly is located and delete it. Please also pay attention to Copy Local property value. If it is false then the old assembly is resided at GAC and you should uninstall it from there.

Path属性允许查找旧程序集所在的位置并删除它。请注意复制当地的财产价值。如果是假的,那么旧的程序集就位于GAC,您应该从那里卸载它。

#2


0  

I think this is the same problem I was having. My solution is the following, which seems to work reliably (for me anyway, in Visual Studio 2015):

我想这和我遇到的问题是一样的。我的解决方案是:

  1. From the File menu, select Close Solution.
  2. 在“文件”菜单中,选择“关闭解决方案”。
  3. From the File menu, click Recent Projects and Solutions and reopen your solution.
  4. 在“文件”菜单中,单击“最近的项目和解决方案”并重新打开解决方案。
  5. Right click on a project in the Solution Explorer and select Unload Project. (I use a project at the tail end of my reference dependencies, something that doesn't depend on other projects, but on which most other projects depend.)
  6. 右键单击解决方案资源管理器中的项目并选择卸载项目。(我在参考依赖项的末尾使用了一个项目,它不依赖于其他项目,但大多数其他项目依赖于此。)
  7. Right click on the unloaded project and select Reload Project.
  8. 右键单击unloaded项目并选择Reload项目。

Et voila! your assembly references for all your projects should now point to the right assembly files. At least they should if your problem was similar to mine.

果不其然!您的所有项目的程序集引用现在应该指向正确的程序集文件。如果你的问题和我的相似,至少他们应该这么做。

In my case, assemblies were referenced via a $(PathToAssembly) MSBuild property, set in an MSBuild targets file included from my project file. When the value of the PathToAssembly property changed, the references were not updating, due to some internal cache in Visual Studio. The above incantation correctly updates the references.

在我的例子中,程序集是通过$(PathToAssembly) MSBuild属性进行引用的,该属性设置在我的项目文件中包含的MSBuild目标文件中。当PathToAssembly属性的值发生更改时,由于Visual Studio中的某些内部缓存,引用没有更新。上面的咒语正确地更新了引用。