How to add external file to application files ( clickonce / .NET)

15,669

Solution 1

I ended up adding it as a reference to my project and setting the Copy Local property to True. Now there is no warning, but make sure you don't accidentally remove it when you click the Unused References button.

Solution 2

I cannot reproduce your warning. Sorry.

However, if you would like an alternative way to deploy the files, I have used custom Prerequisites / bootstraps with my click once deployments to ensure items that must exist in external areas (Click once will only include files in the deployment folder).

Most recently I have deployed templates with VSTO applications. It works well.

Here is a decent reference on creating/adding them to click once deployment: http://msdn.microsoft.com/en-us/library/ms165429(VS.80).aspx

Ernie

Solution 3

In the Project menu, select Add existing item, change the file type to Executable Files and select your files. Then go to your project properties, in the publish tab, click the Application Files button and make sure your files are included

Share:
15,669
Maciej
Author by

Maciej

C# / MS SQL 2005 developer

Updated on July 07, 2022

Comments

  • Maciej
    Maciej almost 2 years

    I'm using 'Publish' option in vs2008 and I'm pretty happy how it works.

    Now I'd like to add 2 external *.exe files to installed package
    I've noticed button 'Application Files...' at publish tab but it seems doesn't allow adding new files manualy.

    I've played with this and found the way how to archive that:
    1. add EXE files to project as external items
    2. change their property 'build action' to content

    Works well now

    but I'm receiving warrning info:

    Assembly 'file_name.exe' is incorrectly specified as a file.
    C:\WINNT\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets  PROJ_NAME
    

    Any idea how to resolve this warning / add exe files to deployment other way?

  • Maciej
    Maciej almost 15 years
    This is exactly I did! (Sorry if my story wasnt clear enough) But the problem now is Build Warning: Assembly 'file_name.exe' is incorrectly specified as a file.
  • Maciej
    Maciej almost 15 years
    Thanks for tip with Prerequisites but (as I understood) this is rather to install something to GAC, run some kind of setups (eg SDKs) I'm rather searching for copy specified exe file to application folder after installation. It works in the way I've described but I'm frustrated this warning...
  • Maciej
    Maciej almost 15 years
    I forgot to say I need to change exe file property 'build action' to content - if not I had build error or file not appeared under 'application files'
  • Jorge Zuanon
    Jorge Zuanon almost 15 years
    Did you try to set the build action to "None", and set "Copy to output directory" to "Copy always" ?
  • Maciej
    Maciej almost 15 years
    Yeah I've tried that but if I did that file didnt appear in 'application files' list. Only chance to achieve that is set property to Content