How to add external file to application files ( cl

2020-08-27 00:58发布

问题:

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?

回答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.



回答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



回答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