IT Community - Software Programming, Web Development and Technical Support

ClickOnce deployment problem

This is a discussion on ClickOnce deployment problem within the C# Programming forums, part of the Software Development category; ClickOnce deployment problem Hi, I am trying to deploy an application that uses a managed library called xyz__lib.dll which ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 05-24-2009, 08:57 PM
shaalini shaalini is offline
D-Web Architect
 
Join Date: Apr 2007
Posts: 633
shaalini is on a distinguished road
Default ClickOnce deployment problem

ClickOnce deployment problem

Hi,

I am trying to deploy an application that uses a managed library called xyz__lib.dll which is a wrapper arround a unmanaged library called xyz.dll. Both files are included in the deployment manifest.

During deployment I get an error saying that file xyz.dll already exists in the temporary deployment directory. I have checked and the file xyz.dll only appears once in the manifest file. My guess is that somehow ClickOnce has figured out that xyz.dll is a dependency of xyz__lib.dll and therefore has deployed both files together. Then it finds the xyz.dll file in the manifest and tries to deploy it again, and fails because the file already exists.

So, I have tried removing the xyz.dll file from the manifest, so that it would be deployed only once, with the xyz__lib.dll wrapper. The file was indeed deployed without it even being in the manifest, which confirms that ClickOnce figured out the dependecy. However, the install then fails saying that the hash of the xyz.dll file doesn't match the one in the manifest (there is no hash in the manifest, since I removed that file).
__________________
Shaalini.S
Be the Best of Whatever you are...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 05-24-2009, 08:58 PM
bluesky bluesky is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 667
bluesky is on a distinguished road
Default Re: ClickOnce deployment problem

Hi,

hard to say what is the issue. Can you post part of your application manifest ? Did you check listings under <assembly> and <file> sections both ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 05-24-2009, 08:59 PM
shaalini shaalini is offline
D-Web Architect
 
Join Date: Apr 2007
Posts: 633
shaalini is on a distinguished road
Default Re: ClickOnce deployment problem

Hi,

Thanks, I am sure that the file wasn't listed twice in the manifest. I still didn't figure out why it wouldn't work but I have solved the issue by deploying the library as data files. This way ClickOnce doesn't try to resolve the library dependencies. MageUI wouldn't let me do that though, so I had to edit the manifest manually.
__________________
Shaalini.S
Be the Best of Whatever you are...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 05-24-2009, 09:02 PM
arjkhanna arjkhanna is offline
D-Web Incredible
 
Join Date: Mar 2007
Posts: 1,949
arjkhanna is on a distinguished road
Default Re: ClickOnce deployment problem

hi,

I had the same issue (using VS2005): I wanted to package some external dlls along with my clickonce package to be distributed in the same directory as my exe, so I added them to my project with their Build Action set to Content and their Copy to Output Directory set to Copy always. This was a problem. ClickOnce would use reflection to include the external dlls' dependencies and then would balk on installation because of multiple copies of the dependent (child) dlls. My solution was simple -- change Copy to Output Directory to Do not copy. ClickOnce will still copy the dlls to the exe's directory (a subdirectory if you put it in a folder under your project) and will not add its dependencies.

I also wanted to deploy an XML file to the same directory as the EXE, but ClickOnce's default action is to seperate XML files to a seperate Data directory (to allow ClickOnce apps with only partial trust to edit/use them -- luckally I'm building a full-trust app). You can see this if you open up your manifest in MageUI, the XML files will default to Data File.
I don't know if there is a Build Action/Copy to Output Directory combination to remove the Data File status, but instead I got my hands dirty with the manifest file.


<file name="XMLFile1.xml" size="52" writeableType="applicationData">
<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>lrkQfsGbVgl5dohdQ+HzEhi9JA4=</dsig: DigestValue>
</hash>
</file>



Removing writeableType="applicationData" will cause the file to be deployed into your application's directory.

Now back to your problem about signing:
After any editing to the manifest, you must resign it. By default, ClickOnce generates a temporary key if you publish an application without signing it first, and signs it with that key. If you edit the application manifest, the easiest way to sign it is to open it up in MageUI and save it. This will prompt you for a key to sign with. You may want to give your key a friendly name if you have more than one temporary key to make sure you can pick out the same key to continuously sign with (in Internet Settings | Content tab | Certificates button | Double Click a certificate | Details tab | Edit Properties button | type in a friendly name). After signing the application manifest, open and save (resign) the deployment manifest, as it hashes the hashed application manifest. Step by step instructions how to do that are here:
CoDe Magazine - Article: ClickOnce for the Real World, Not Hello World
__________________
A.Rajesh Khanna
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 05-24-2009, 09:02 PM
bluesky bluesky is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 667
bluesky is on a distinguished road
Default Re: ClickOnce deployment problem

Hi,

You can change the XML files from being published as data files to just being included. You do this in the Application Files dialog from the Publish tab. Just change it from "Include (Data)" to Include or IncludeRequired.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 05-24-2009, 09:09 PM
nnraja nnraja is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 144
nnraja is on a distinguished road
Default Re: ClickOnce deployment problem

Hi,

It has been a while since anyone posted to this, but it is still a pretty painful problem when you run into it. I am really struggling to figure out a magic combination to get my application to still deploy with ClickOnce.

I am trying to add a set of assembly DLLs, 3 of which all depend on the native code obfuscation DLL rscoree.dll. Of course, the native DLL is not listed as a deployment file, but rscoree.dll.deploy shows up in the ClickOnce deployment directory, and I get the same error that rscoree.dll already exists in the temporary deployment directory.

Now I am stuck trying to disconnect the web of assembly depenencies to excise rscoree.dll, so I can add it as content. Not as easy as it might seem.

Sure would be great to see a fix to this issue.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 05-24-2009, 09:10 PM
nnraja nnraja is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 144
nnraja is on a distinguished road
Default Re: ClickOnce deployment problem

Hi,

And the final solution for me appears to be:

1. In Publish / Application files form exclude all but one assembly referencing the native DLL

2. Put copies of the excluded assemblies in the root of your project

3. Mark them as "Content" and "Copy if newer"

I still get warnings during my build that I have assemblies marked as files, but apparently they get published without trying to pull in the native DLL, and I can install without error.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Licence File before installation starts in ClickOnce Luttappi C# Programming 0 07-08-2009 11:08 PM
Dual Server deployment on windows 2008 bluesky Server Management 4 06-03-2009 02:40 AM
Publish ClickOnce VSTO Add-Ins: How to deploy language packs? shaalini C# Programming 2 05-25-2009 02:15 AM
Updating application deployed using ClickOnce in Master - Slave setup bluesky C# Programming 2 05-24-2009 08:43 PM
Is it possible ClickOnce without sandbox? bluesky C# Programming 7 05-24-2009 07:33 PM


All times are GMT -7. The time now is 09:56 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0