tags:

views:

50

answers:

3

I'm having a problem deploying a click once application. I'm using VS 2008. I have a reference dll that is not being deployed.

In the project properties -> publish tab -> Appication Files

The referenced dll does not appearso I can't add it.

The dll is not used directly in my code- however it is used by another dll that I reference.

Is there a way I can manually edit something to ensure the dll is copied over?

Might be worth mentioning that the dll is a third party dll from devExpress: DevExpress.XtraPrinting.dll I think it may be loaded as a plugin by one of the other DevExpress dlls.

Thanks in advance.

+2  A: 

I know this problem rather well and there a few things to do to fix it:

  1. Add a reference to the DevExpress.XtraPrinting.dll dll in you project.
  2. In the references section set the DevExpress.XtraPrinting.dll to Copy Local = true (this seems to help VS remember the dll more)
  3. To force VS to know that you need this dll you will need to use it. This can be done by instantiating an instance of ExportOptions or some similar object. e.g.

    var options = new ExportOptions(); options.Html.Title = "some text";

  4. Now make sure to forcefully set the Publish Status to "Include" in the ApplicationFiles section of the Publish tab.

That should solve your problem.

FryHard
Thanks for your help. However the dll still doesn't appear in the application files box (even with show all selected). My other dev express dlls do show up with exclamation makes beside them.I used you code snipppet in my main form, is there anything else I should check?
bplus
I have updated answer with one more step (step 2) normally setting Copy Local=true helps.
FryHard
A: 

Add the 3rd party dll to your project (right-click on project, add existing item...). Set build action to none, set 'copy to output directory' to 'do not copy'. Delete your reference to that dll. Re-add the reference, and browse to that dll IN your project and select it. On the reference, set 'copy local' to 'true'. NOW it should show up in application files because your code references a local copy, and it is set to deploy it.

Note that this doesn't work for all assemblies, some just MUST be installed in the GAC. But it's free to try. If it has to be in the GAC, it will tell you when you try to install it.

RobinDotNet
A: 

Thanks for the replies - however I found that manually editing the csproj file worked for me. For anyone else with this problem you may need to add your dll that you want deployed like this:

<PublishFile Include="DevExpress.XtraPrinting.v9.3">
  <Visible>False</Visible>
  <Group>
  </Group>
  <TargetPath>
  </TargetPath>
  <PublishState>Include</PublishState>
  <IncludeHash>True</IncludeHash>
  <FileType>Assembly</FileType>
</PublishFile>

Also ensure you have this in your references section:

<Reference Include="DevExpress.XtraPrinting.v9.3, Version=9.3.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\SomePath\DevExpress.XtraPrinting.v9.3.dll</HintPath>
</Reference>

I'd also like to point out that RobinDotNet's solution also works.

bplus
I would be very surprised if the instructions I posted didn't work for you -- just curious if you tried them. They are tried and true in every other case that I've posted them either here or in the forums, so if there's a problem, that would be helpful to know.
RobinDotNet
I did try them as soon as I read them. Actually they did work (i'll edit my reply in a second) but I found myself in a dll dependency chain that I had to use ".net Depends" to get out off. During that process I noticed in the my csproj file that references where not getting written. So I back out of your solution and just tried editing the file manually and it worked. Thanks again for taking the time to rerply, I should have made it clear that your response works too.
bplus
No worries, thanks for letting me know. I'm just glad you have it working. :-)
RobinDotNet