none
Is there a VS version dependent way of creating custom assemblies folders?

    Question

  • Hi!

    I've created an Extension that is diffrent for each version of VS. This is because of a dependency to a private assembly dll that is distributed with VS Enterprise/Ultimate. I do not want to create diffrent versions of the dll, using the assembly version, since unfortunatly this version number is used in other parts of VS (webtests) and changing the version woul break functionality.

    Today, I put the assemblies in a MyAssemblies folder that is added as a reg key under the key for the current user (SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\MyAssemblies). However, this causes problems if the user has several VS installations of diffrent versions (like both 2015 and 2017) since the DLL is diffrent for those versions.

    Is there a way to create a custom folder, that will ONLY be searched by the actual VS install instance rather than a specific version of .NET? I.e. I want to create it for the user (not all users) but also only for VS2015 and a diffrent one for VS2017. However, 2015 should NEVER use the 2017 folder and vice versa, when resolving assemblies added as references to a Project.

    I can see that this was possible before, in older versions of VS (like version 7 and 8 it seems) by creating reg keys under those VS versions instead, and using AssemblyFolder as the name for the key in the Registry. I tried this for version 14 and 15 but they seem not to work, VS will not find/resolve DLL's in those folders.

    Friday, February 09, 2018 3:13 PM

Answers

  • I've decided on a different approach.

    Since the extensions DLL's after installation in VS are accessible to the extension itself, as private assemblies, I will simply provide a button in the Tools menu for the user to install the DLL into the current Project as a referenced assembly, inside a Project local folder in the solution. This way the DLL will also be checked into version Control and be available after checkout on Another machine, and assemblies in the solution are resolved Before any other paths.

    Extensions are installed on a per user basis and per VS installation, so this solves my problem just fine, without any dependencies to external feeds or internet.

    Friday, February 23, 2018 3:42 PM

All replies

  • To explain my question in a simpler way, I'm looking for something similar to the PublicAssemblies folder in the installation folder of Visual Studio, which is diffrent for each major version of VS. But, that will affect every user. I'm looking for a PublicAssemblies alternative that is user specific, either predefined somewhere in the users home directory, or a Registry Key I can use to Point at a folder that does the same thing.

    Note: I want not just the assembly resolver to work, I would like the assembly to show up in the Add Reference GUI as well, but I could live without that feature. 

    Friday, February 09, 2018 3:17 PM
  • Hi chgerdes,

    This forum discusses and asks questions about extending and integrating with Visual Studio, since your issue is more related to visual studio general, we'll move the thread to visual studio general forum for suitable support.

    Thanks for your understanding and cooperation.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 12, 2018 6:15 AM
  • Hi chgerdes,

    If you want to create custom assembly folder and refer to it in your project, why not create the Nuget feed by yourself?

    https://docs.microsoft.com/en-us/nuget/hosting-packages/overview

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 12, 2018 8:07 AM
    Moderator
  • Hi chgerdes,

    Is the Nuget Feed the solution you want to use? Any feedback about this issue?

    Sincerely,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, February 14, 2018 5:47 AM
    Moderator
  • I was aware of the Nuget Package option, however that would require an internet Connection so the dll can be downloaded into the Project, and requires the Project to be built in order to trigger the download of missing packages. My target audience for the extension is primarily performance testing and thats in almost all cases done in an isolated Environment without internet access. So, all dll files need to be installed by the extension. Also, the dll contains plugins for webtest and loadtest items, and these plugins will not show/be available for the user if the DLL is not loaded. The DLL will not auto load on "new" test Projects unless I try to Catch that scenario and try to download and load the dll using nuget, and without an internet Connection, this will break. End result will not be pretty.

    So the answer to my question is that it is not possible to tell a specific Visual Studio version to use a specific folder to search for DLL's for a specific user only? 

    Can't a user extension install a public assembly for that user? (Without using the system wide public assemblies folder in the installation directory)

    I guess my only option then is to not support user based extensions, only system wide extensions, so that I can use the existing PublicAssemblies folder in the VS install directory.


    • Edited by chgerdes Monday, February 19, 2018 4:35 PM
    Monday, February 19, 2018 4:04 PM
  • Hi chgerdes,

    If it has no network, I agree with you, it would have a limitation to use the Nuget package unless you just use local Nuget feed for all users who have enough visit account in the same Machine.

    My understanding is that all default assembly in the VS setup path was wrote to the regedit, if you want to use another custom folder, we can change the regedit, but it has the risk for our developing Environment, so I think it was also not a good suggestion.

    Actually one issue is that whether all users are in the same machine or different machines, if they are in the same machine, just give them enough visit permission, and use the local nuget feed will be ok. But if they are in different machines, you would think about using the network. 

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 20, 2018 2:33 AM
    Moderator
  • We do have several diffrent performance testers working on the same machine, using individual user accounts. If one user updates his/hers plugin and extension, I do not want others on the same machine using the same VS version to get affected. Thats why I'm looking for a way to create a public assemblies folder that is both user and VS version specific.

    If you do know which Reg Keys that are used ONLY by a specific VS version, I would be so happy to find out. CUrrently I use the Reg Keys under .NET Framework, which are user specific, but are NOT VS version specific, only specific to a certain version of the .NET Framework.

    Tuesday, February 20, 2018 1:29 PM
  • Hi chgerdes,

    It was not easy to find the reg keys for all assembly references. I just provide it as a sample:

    Like this document:

    https://support.microsoft.com/en-us/help/324168/how-to-deploy-an-assembly-to-the-target-computer-global-assembly-cache

    Maybe you could create a setup project which included all assemblies even if in different machines.

    Or just create local feed if all users are in the same machine:

    https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, February 21, 2018 4:00 AM
    Moderator
  • Correct me if I'm wrong, but wouldnt putting the assembly in the GAC affect ALL users and ALL versions of VS?

    Thursday, February 22, 2018 12:15 PM
  • Hi chgerdes,

    >>but wouldnt putting the assembly in the GAC affect ALL users and ALL versions of VS?

    >>Thats why I'm looking for a way to create a public assemblies folder that is both user and VS version specific.

    It would have a limitation for it.

    If we use the local feed as my previous suggestions, for example, there are two admins in this machine, one user configure the Local Feed under TOOLS->Option->Nuget Package Manager. Then another user try to log-in the same machine, view the Nuget package manager, it seems have no this feed, if so, it would not impact the second user to use the VS IDE, but it doesn't meet the requirement as yours.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 23, 2018 9:13 AM
    Moderator
  • I've decided on a different approach.

    Since the extensions DLL's after installation in VS are accessible to the extension itself, as private assemblies, I will simply provide a button in the Tools menu for the user to install the DLL into the current Project as a referenced assembly, inside a Project local folder in the solution. This way the DLL will also be checked into version Control and be available after checkout on Another machine, and assemblies in the solution are resolved Before any other paths.

    Extensions are installed on a per user basis and per VS installation, so this solves my problem just fine, without any dependencies to external feeds or internet.

    Friday, February 23, 2018 3:42 PM
  • Hi chgerdes,

    Thanks for sharing your solution here, since this issue has been resolved, if possible, you could mark helpful reply as the answer.

    Have a nice day,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 26, 2018 1:32 AM
    Moderator
  • Sure thing, thanks for all the tips and help :)
    Tuesday, February 27, 2018 10:37 AM