Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup the target output path of a given resource file in Visual Studio

In the main project of my VS Solution I have a Resources folder with some required external tools. When building and publishing the solution, I get a .\Resources* with all required files there. So far so good.

However I have to move some files to the parent directory. My first attempt was do so with the Post Build Events. It works and does move them the correct folder. Nevertheless in the publish output they still appear in the Resources folder and I need them in the parent one :/

Is there any way to setup the target output path for resources in Visual Studio?

like image 543
Bruno Avatar asked May 04 '11 16:05

Bruno


People also ask

How do I change the output path in Visual Studio?

Right-click on the project node in Solution Explorer and select Properties. Expand the Build section, and select the Output subsection. Find the Base output path for C#, and type in the path to generate output to (absolute or relative to the root project directory), or choose Browse to browse to that folder instead.

How do I find the path of a file in Visual Studio?

Ctrl+Click or Double Right Click to Open Containing Folder, Right click to Copy Full Path. This lightweight extension lets you display the full path of the file at bottom of Visual Studio's Editor.


1 Answers

After some research and experimental, I solved my problem. Still, here's what I learned in the process.

The first attempt was adding the file to the project root and mark it as a resource. After publishing it worked. But having those files in the project root its lame.

Since I needed some *.exe files compiled in another VS solution, added them as a project reference. Gave it a try and it passed the "Publish" test. But still.. not the best way to do it.

After that, with some scripting and a post-build event, I copied the required files to the correct folder. Works.. but after publishing, they don't appear in the package.

However, there is still a possibility with the Mage tool:

http://msdn.microsoft.com/en-us/library/acz3y3te.aspx

This lead to some promissing experiments, however they ended up helping me realize how limited the MS ClickOnce is, so I decided to try other tools.

Here's a good start to follow: What alternatives are there to ClickOnce?

like image 120
Bruno Avatar answered Oct 15 '22 01:10

Bruno