SmartAssembly v7.5.0 doesn't embded assembly complaining it's not located in input directory

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
Tagged:

Answers

  • j_ogurekj_ogurek Posts: 11 Bronze 1
    Almost two weeks passed and NO response?
  • Jessica RJessica R Posts: 1,319 Rose Gold 4

    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?


  • j_ogurekj_ogurek Posts: 11 Bronze 1
    See attached sample project and screenshot, BTW previous versions worked fine...


  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thank you!

    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?


  • j_ogurekj_ogurek Posts: 11 Bronze 1
    Here is the verbose log...
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thank you!

    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?


  • j_ogurekj_ogurek Posts: 11 Bronze 1
    What settings you mean? There's whole sample solution attached including saproj file...
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi there,

    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?


  • j_ogurekj_ogurek Posts: 11 Bronze 1
    There's no such entry, take a look at the attached setting.
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thanks @j_ogurek!

    Our developers have asked the following: 
    • Is DevExpress currently installed on your machine?
    • The DevExpress installer would normally create a registry key in HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\vX.Y\AssemblyFoldersEx (or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\vX.Y\AssemblyFoldersEx), where X.Y is the runtime version (e.g. v4.5.25000, v4.0.30319, v2.0.50727 etc.) - does this exist?
    • If so, what is the value of the key? 

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • j_ogurekj_ogurek Posts: 11 Bronze 1
    I've exported the whole branch, take a look inside, please.

    HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework
  • Jessica RJessica R Posts: 1,319 Rose Gold 4

    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:

                                                                                                             <!--    add this:                             -->
    <Assembly AssemblyName="DevExpress.Data.Desktop.v20.2, Culture=neutral, PublicKeyToken=b88d1754d700e49a" MandatoryPath="DevExpress.Data.Desktop.v20.2.dll">
        <Merging />
        <Embedding Compress="1" Encrypt="1" />
    </Assembly>

    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?


  • j_ogurekj_ogurek Posts: 11 Bronze 1
    Sorry, I don't get it. Do I have to edit all 150 entries manually? Are you serious? OK, can you do it for me, please? Here's my saproj file...
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    edited December 17, 2020 1:40AM
    Hi @j_ogurek!

    You can used the find&replace dialog in Notepad++ or similar, looking for all instances of AssemblyName="(DevExpress.*?), and replacing them with HintPath="$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?


  • j_ogurekj_ogurek Posts: 11 Bronze 1
    @Jessica R After three months this bug is still open, this makes SmartAssembly useless for me - I am not able to manually add every single ref assembly attribute in every single project, so I have to publish unpotected binaries for past months. Can you let me know if you plan to fix this bug or not? If I stay with red-gate or move to other obfuscator, thank you.
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi @j_ogurek,

    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?


  • Jessica RJessica R Posts: 1,319 Rose Gold 4

    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?


Sign In or Register to comment.