SmartAssembly v7.5.0 doesn't embded assembly complaining it's not located in input directory
j_ogurek
Posts: 11 Bronze 1
SmartAssembly v7.5.0 doesn't embded assembly complaining it's not located in input directory, but it is!
Screenshot: https://i.ibb.co/FHcKhXK/screen.png
Screenshot: https://i.ibb.co/FHcKhXK/screen.png
Tagged:
Answers
Hi @j_ogurek,
Apologies we weren't able to reply on this sooner!
It looks like SmartAssembly is using the dll from theDevExpress install folder.
Just to confirm, is your main assembly located in c:\Program Files (x86)\DevExpress 20.2 as well? If it is, and SmartAssembly still isn't detecting it, is it possible for you to share your project and assembly files with us to test with?
(On the other hand, if the main .exe/.dll is in another location, placing a copy of the DevExpress file in the same location should resolve this.)
Thank you!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
It's oddly working alright for me even with the latest version:
Can you please enable verbose logging (Tools>Configure logging), load your project, and then send across you the log? That should hopefully shed some light on how it's locating the dependency on your machine.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
It looks like it's just going straight to the Program Files directory for the DevExpress files.
There aren't any mandatory or hint paths in the saproj file, but can you please check your settings file to see if it mentions the Program Files location?
%ProgramData%\Red Gate\SmartAssembly 7\SmartAssembly.settings
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
There's a specific file, SmartAssembly.settings, located in %ProgramData%\Red Gate\SmartAssembly 7 which doesn't get stored in the solution folder, unfortunately.
There might be a
<
DependenciesSearchPaths>
in that SmartAssembly.settings file which is directing SmartAssembly on your machine to use dependencies in c:\Program Files (x86)\DevExpress 20.2.Can you please check the file to confirm if this may be the case?
(More detail on how SmartAssembly locates dependencies is available here: https://documentation.red-gate.com/sa7/troubleshooting/unexpected-behavior-and-technical-questions/how-smartassembly-searches-for-dependencies)
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
Our developers have asked the following:
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework
Hi @j_ogurek,
Thanks for sending that over!
Our developers have clarified that as of SmartAssembly 7.5.0, framework folders take precedence over assembly's output directory. Because DevExpress adds itself to framework assemblies list in the registry, SmartAssembly treats it as framework assembly and doesn't allow to merge or embed it.
We're going to investigate this further and have logged an issue in our tracking system with reference SA-2421.
For now, the workaround would be to use HintPath or MandatoryPath in .saproj to force SmartAssembly to pick up the assembly from the main assembly folder, not a framework folder. For example:
Note that MandatoryPath expects either an absolute path or a path relative to the .saproj project file.
Hope that helps for now!
(Other alternatives would be to build the project on a machine without DevExpress installed or downgrade to SA 7.4.6.)
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
You can used the find&replace dialog in Notepad++ or similar, looking for all instances of
AssemblyName="(DevExpress.*?),
and replacing them withHintPath="$1.dll" AssemblyName="$1,
(using Regex).(HintPath or MandatoryPath will work)
The modified project file is attached which uses HintPath.
Using the HintPath has worked in our test but please let us know if the issue persists for you.
Please note that the path will have to be adjusted if the project file isn't in the same directory as the assemblies, as HintPath expects the path to be relative to the .saproj project file.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
So sorry that we haven't been able to fix this yet!
I'm afraid there haven't been any updates as far as I'm aware, but I will double-check this with our developers, please bear with me.
I know downgrading is not an ideal option, but a simpler workaround could be to use version 7.4.6 available here (note that you would need to uninstall the latest version before installing this). Would you be able to give this a try?
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
Hi @j_ogurek,
I'm really sorry to say that we're still unable to give an ETA on this as our developers are working on other bug fixes at the moment.
At the moment, the only workarounds would be to:
- Use HintPath or MandatoryPath in the saproj file (using the find&replace dialog in Notepad++ will hopefully make this easier!)
- Using the older version of SA which did not have this issue, v7.4.6 available here
- Build the project on a machine without DevExpress installed
Apologies again as I know this is not the answer you were hoping for and the workarounds are not ideal, but I do hope one of the options above may work for you!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?