Can I access assemblies in Visual Studio PublicAssemblies folder

Shelley xie 1 Reputation point

I have an executable application which has references to other projects. The other projects has references to the assemblies located at C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\PublicAssemblies folder.
I cannot copy these assemblies from PublicAssemblies folder to my executable project bin path.
I tried to configure these assemblies location in the executable application config file, as below:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="Microsoft.VisualStudio.Shell.Interop"
culture="neutral" />
<codeBase version="7.1.40304.0"
href="file://C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.Shell.Interop.dll"/>

The configuration works. But the file location is hardcode. If I install my executable application on another machine which installed Visual Studio in the other place, then this config file will not work any more.

I would like to know if any way to give a dynamic path in the href tag?

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,981 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,101 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ken Tucker 5,841 Reputation points

    Use the nuget package instead of referencing the dll in the visual studio folder

    0 comments No comments