| Author |
Message |
MidSilence
Joined: 25 Aug 2010 Posts: 5
|
Posted: Wed Aug 25, 2010 4:51 pm Post subject: Error using CryptoLicensing |
|
|
Hello!
I'm using CryptoLicensing with Smartassembly and I've got some errors.
In VS2008 design-time, referenced CryptoLicensing assembly works perfect and builds the project. I can see assembly details.
When using Smartassembly, it adds multiples assemblies in project as follows:
SA 4.2
| Code: |
<Assembly AssemblyName="LogicNP.CryptoLicensing, Culture=neutral, PublicKeyToken=4a3c0a4c668b48b4" />
<Assembly AssemblyName="">
<Merging />
<Embedding />
</Assembly>
<Assembly AssemblyName=", Culture=neutral, PublicKeyToken=null" /> |
SA 5.1
| Code: |
<Assembly AssemblyName="LogicNP.CryptoLicensing, Culture=neutral, PublicKeyToken=4a3c0a4c668b48b4">
<Merging />
</Assembly>
<Assembly AssemblyName=", Culture=neutral, PublicKeyToken=null">
<Merging />
</Assembly>
|
When I build SA project, I'got an invalid token accessing an enum from CryptoLicensing. I think SA is using the wrong assembly to build the project. I've tried the SA.com (command prompt) with no success.
Is there some way to force which assembly to use? Any ideas to solve this?
Thanks! |
|
| Back to top |
|
 |
Alex.Davies
Joined: 02 Dec 2008 Posts: 335 Location: Cambridge, uk
|
|
| Back to top |
|
 |
MidSilence
Joined: 25 Aug 2010 Posts: 5
|
Posted: Thu Aug 26, 2010 1:54 pm Post subject: |
|
|
Using MandatoryPath doesn't work.
What happened is that SA doesn't recognize CryptoLicensing assembly correctly (the assembly is already obfuscated). It always found the assembly with wrong name.
If I use MadatoryPath with the AssemblyName = "LogicNP.CryptoLicensing, Culture=neutral, PublicKeyToken=4a3c0a4c668b48b4" I've got an error saying that the path assembly is not the same as its name. But, if I use AssemblyName = ", Culture=neutral, PublicKeyToken=null" SA founds the assembly but doesn't compile.
Since SA always rescan the dependencies I can't change project file to force to use the correct name; it always change the project creating 2 or 3 items with worng names in the SA project as I said before.
I'm still looking for a solution for this.
Thanks! |
|
| Back to top |
|
 |
slaphead99
Joined: 10 Mar 2010 Posts: 93
|
Posted: Thu Aug 26, 2010 7:44 pm Post subject: |
|
|
| I'm a little confused as to why you are processing these third party, obfuscated, assemblies? What happens if you do not apply any smartassembly features to the third party assemblies? |
|
| Back to top |
|
 |
MidSilence
Joined: 25 Aug 2010 Posts: 5
|
Posted: Thu Aug 26, 2010 8:37 pm Post subject: |
|
|
It's very simple.
Download CryptoLicensing (http://www.ssware.com/cryptolicensing/cryptolicensing_net.htm), install it, create an console project in Visual Studio and add the reference to LogicNP.CryptoLicensing.dll.
After, create a new SA 4/5 project and select the new console project .exe.
You'll see that SA 4/5 cannot read the CryptoLicensing assembly correctly, adding 3 assemblies in SA project file and show one empty item (item with no caption/text) on SA assembly dependencies list.
That's it. |
|
| Back to top |
|
 |
Alex.Davies
Joined: 02 Dec 2008 Posts: 335 Location: Cambridge, uk
|
Posted: Fri Aug 27, 2010 12:22 pm Post subject: |
|
|
The CryptoLicensing assembly is invalid. It has two Assembly metadata items.
The next EAP will read the first Assembly metadata item instead of the second, the same as the CLR does. This means that you can process your assembly. _________________ Alex
Developer,
Red Gate .NET Tools |
|
| Back to top |
|
 |
MidSilence
Joined: 25 Aug 2010 Posts: 5
|
Posted: Fri Aug 27, 2010 1:23 pm Post subject: |
|
|
Thank you!
I'm waiting for the new EAP.
Sorry I didn't make myself clear in older posts. |
|
| Back to top |
|
 |
|