Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone! I'm making an add-in for Visual Studio 2012 and my add-in is almost finished but I got stuck in a small section. So my add-in basically creates a resource file and adds it to the project. I used ResXResourceWriter to make the resource file and then I used the DTE object to add the resource file to the project.

Here's where I'm stuck: I want to add the resource file to the project but in a specific folder which is the App_LocalResources folder. My add-in does add the file to the project but not in that folder. Is there a way to do this?
Posted
Comments
praks_1 4-Jul-13 3:13am    
you can use :
PostBuild events of project
Cardslash 4-Jul-13 10:16am    
that doesn't work

1 solution

There are several ways to do this. What I describe is how I do that kind of thing.

Exit Visual Studio and edit the xx.csxproj file with a non-VS editor (eg. Notepad). Find the file reference in the code and simply add any extra directory structure to the filespec. Be careful to double up backslashes ("\\") where required. You can change relative directory names to absolute if you like. Don't forget to do this for all configurations (eg. Debug, Release, ...).

[disclaimer: I do this type of thing frequently for C++ project files; hopefully I have translated this correctly into C# lingo.]

[Update 1]
Create the resource file first, in the location of your choice. Add the file to the project. Depending on where the file/folder exists, VS will make either a relative or absolute reference to it.
 
Share this answer
 
v2
Comments
Cardslash 5-Jul-13 2:17am    
Here's the thing: I want my add-in to do all the job here. I don't want to edit some files to get the correct output.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900