Ok, I have a very strange problem. I have a class library and I create a windows forms application that uses it. I Publish it as a ClickOnce online only setup. When I try to run it it fails the validation and I get:
ERROR DETAILS
Following errors were detected during this operation.
* [01/06/06 9:47:45 PM]
System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- Reference in the manifest does not match the identity of the downloaded assembly MyLibrary.dll.
- Source: System.Deployment
However, if I open the manifest file, I can see:
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true"
codebase="MyLibrary.dll" size="839680">
<assemblyIdentity name="MyLibrary" version="1.0.0.0"
publicKeyToken="CD1B3EF0334774BA" language="neutral"
processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform
Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>utSMeQVcBCu2swZOvGyNc+YHXWI=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
And these are the EXACT identities of the assembly which I can see with ildasm. Moreover, if I remove the .deploy and I run the application locally, it works... Both assemblyes, the class library and the windows forms application are signed, the application is deployed as full trust.
So, what gives Why does the assembly fail validation
Thank you,
Iulian

ClickOnce, assembly validation failed.
isoandy
Ok, I managed to solve this myself: Here is what happened: the class library was a VS2003 project converted to VS2005. The .snk file used to sign it was an .snk file creaed with the sn.exe from framework 1.1. While nothing seemed not to be working, still, I resigned the assembly with a VS2005 generated key file and... voila, now ClickOnce deploys and works perfectly...
Regards,
Iulian Ionescu
Guido Draheim
I will log a "spec" bug regarding your findings/suggestions. I am not clear on all the issues with obfuscating and click once but having folks look at this again may be interesting at least.
Thanks for your information!
-Robert Schoen (MS Visual Basic QA)
Chris Lyon - MS
Glad that you were able to solve this! I will take a look at this on my side to see the repro and report the problems that I find. Thanks for posting your solution!
-Robert Schoen (MS Visual Basic QA)
Jagatheesan
Ok, it seems as I rushed a little with the conclusion. Now, after further tests it looks as if not the version of the .snk file is at fault but the fact that we need to resign the library. This is what was happening:
Compile->Sign with 1.1. key->Obfuscate->Resign->ClickOnce fails
Then we changed and tested:
Compile->Sign with 2.0. key->ClickOnce Succeeds
The conclusion I quickly draw was that the version of the key was at fault. But then:
Compile->Sign with 2.0. key->Obfuscate->Resign->ClickOnce fails
So, this means that it's not the key that generates the problem but the fact that the assembly is obfuscated and then resigned... I will have to go back and do more tests. I wonder why would resigning create this problem and I also wonder if the obfuscation process may have anything to do with it. In both cases there is nothing that seems obvious, but I'll keep trying...
Thanks,
Iulian
qifeng
Thanks, Elizabeth.
However, this still bares the question: why The obfuscated assembly is resigned and doesn't fail any check, it can be reflected with ildasm and it can be loaded by the system. So, I think that theoretically it should work... Maybe in a future version
Thank you,
Iulian
NickJ
Iulian,
I'm sorry but ClickOnce in Visual Studio does not work with obfuscated assemblies.
Regards,
Elizabeth Maher
Cyril Porseland
I kept trying it at no avail. I deployed my application to 3 different customers who complained that they cannot use the library to create a ClickOnce deployement. We had to give them the unobfuscated assembly and it worked... I still have no idea why would this happen.
Iulian
CWIUS
Cool - thanks for the additional info. I will pass this posting on to our click once expert and see what we have. I know that there are some interesting scenarios when combining clickonce and signing assemblies. Stay tuned.
-Robert Schoen (MS Visual Basic QA)
Naveen koul
Here are some other threads related to this topic that may be of interest. Hopefully this will help you work through some of these issues.
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=124904&SiteId=1
and
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=211925&SiteId=1
-Robert Schoen (MS Visual Basic QA)
Viper32
Could I use obfuscating on a click once application Are their any articles on how to do this We are almost ready to deploy our application and would like to obfuscate our code.
Thanks
HW