Cannot obfuscate using MSBuild

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, melvyn.harbour, dom.smith

Cannot obfuscate using MSBuild

Postby Mikhail Girkin » Mon Jun 24, 2013 11:02 am

Hi!

We are experiencing strange problems with RedGate SmartAssembly while obfuscating a solution using MSBuild.

Let me explain in detail.

1) The error we've got:
SmartAssembly build failed:
Cannot find dependency 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null', which is required for assembly:
AxInterop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null
HTMLEditorControl, Version=1.0.4923.24795, Culture=neutral, PublicKeyToken=49fa31e76fed3520
OrganizationWeaver, Version=1.0.0.0, Culture=neutral, PublicKeyToken=49fa31e76fed3520

Ensure that this dependency is in the main assembly folder, or in the Global Assembly Cache (GAC).

2) We tried to do this on various computers, and all of them got the error like that. But it happened with different dll's (NLog, Antlr3.Runtime)

3) .saproj file contains:
<Assembly AssemblyName="Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null" MandatoryPath="..\\Prereqs\\Interop.SHDocVw.dll">
<Merging Merge="0">
<Pruning Prune="0">
<Exclusion />
</Pruning>
<Obfuscation Obfuscate="0">
<Exclusion />
</Obfuscation>
<ControlFlow Obfuscate="0" />
<MemberRefsProxy Proxy="0" />
<ResourcesCompression />
</Merging>
<Embedding Embed="1" />
</Assembly>

As you can see, we intentionally specified MandatoryPath attribute, and all the dll's are there.

How could we tackle this problem?
May be we incorrectly understand path calculcation in SmartAssembly? What path it takes as a starting point?
Mikhail Girkin
 
Posts: 4
Joined: Mon Jun 24, 2013 10:54 am

Postby Chris.Allen » Tue Jun 25, 2013 12:09 pm

Can you retry but use absolute paths and not relative paths?
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby Mikhail Girkin » Wed Jun 26, 2013 2:36 pm

We tried. It didn't help.
Also I noticed, if I make a mistake in the path to dll's - it shows completely anoher error, like:

SmartAssembly build failed:
Mandatory assembly 'C:\\Users\\Mike V. Girkin\\Documeasdnts\\Projects\\Tor\\OW_Fresh\\Prereqs\\AxInterop.SHDocVw.dll' not found for 'AxInterop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=49fa31e76fed3520'

So our error is not connected to the paths, and SmartAssembly could find the dll's. But it shows that it could not.

The most strange thing is, that on different computers, the dll it could not find - differs.
Mikhail Girkin
 
Posts: 4
Joined: Mon Jun 24, 2013 10:54 am

Postby Chris.Allen » Wed Jun 26, 2013 2:55 pm

There's a difference in the public key token value each time- can you check you are specifying the right tokens?

Does it help if, instead of using mandatory path, the assemblies are put in the GAC (if only for testing purposes)?
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby Chris.Allen » Wed Jun 26, 2013 3:11 pm

Pleas ensure you have the very latest version too (Check for updates, on left in GUI). There have been some bug fixes to assembly resolution.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm


Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 1 guest