Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 3-Jul-13 21:16pm
Comments
praks_1 at 4-Jul-13 3:13am
   
you can use :
PostBuild events of project
Cardslash at 4-Jul-13 10:16am
   
that doesn't work

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
v2
Comments
Cardslash at 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)

  Print Answers RSS
0 OriginalGriff 505
1 Maciej Los 309
2 BillWoodruff 174
3 /\jmot 160
4 Suraj Sahoo | Coding Passion 160
0 OriginalGriff 8,484
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,159
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 5 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100