Referenced DLL Search Path's

s_tapsons_tapson Posts: 3 New member
edited July 3, 2018 10:54AM in SmartAssembly
Hi,

I'm busy trialling SmartAssembly, and I've hit a bit of an issue with referenced DLL's. The DLL I'm testing it on references another DLL which is located within a sub-folder. So I'm hoping there's a way to specify that SmartAssembly should search sub-folders?

I'm aware of the DependenciesSearchPaths tags in SmartAssembly.settings, however this doesn't really fit my needs as I want to allow for the possibility of building multiple repo's which may be using different versions of a DLL with the same name. Unless those search paths will search for a DLL with a specific name and version number?

Thanks in advance
Stuart
Tagged:

Best Answer

  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Accepted Answer
    Hi @s_tapson,

    Thanks for your post!

    There unfortunately isn't a way to tell SmartAssembly to automatically search subfolders at the moment, so you would need to either specify the subfolder as a DependenciesSearchPath, or specify the exact path for the dependency by adding a MandatoryPath to your saproj. 

    When searching for a dependency, SmartAssembly will use whichever copy of the dependency it finds with the same name, though it doesn't require it to have the same version number.

    I unfortunately don't think there is another option for this aside from separate saproj files for each version with a MandatoryPath pointing to the needed dependency file, but just to make sure I'm understanding correctly (in case there is something else that might help): you have different versions of your main dll that reference different versions of the dependency? (and so the DependenciesSearchPaths wouldn't work since SmartAssembly would always take the version in the first DependenciesSearchPaths)

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Answers

  • s_tapsons_tapson Posts: 3 New member
    Hi Jessica

    Yes that's correct I want to allow for having different versions of the same DLL, mainly so that if we're building an older version of our product for whatever reason it reference the correct DLL. 

    I have managed to get something working using DependenciesSearchPaths. At the start of each build, I remove any existing SearchPath nodes, then read a list of required paths from a text file (stored in the repo I'm building) and add those as SearchPath nodes. Its not ideal, and not as clean as I'd like but it does work and allows for different versions.

    Thanks

    Stuart
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thanks for the update, @s_tapson! Glad to hear you've found a workaround though I know it's not ideal.

    I think it would help if there was a way to add different search paths for each project, with the added ability to use relative paths. We actually have a feature request for this already with reference SA-889, so I've +1'd this with your details.

    Thank you and sorry again that there isn't a cleaner way to do this currently!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.