How to have different solutions refer to one resx file?

后端 未结 7 2192
野趣味
野趣味 2021-02-04 09:47

I have one resx file and I want to use it from several solutions\\projects , and i don\'t want to have local copy at each solution(only at compile time bring a copy).

Is

7条回答
  •  無奈伤痛
    2021-02-04 10:25

    One issue people are missing is that when you click the Add button when choosing the file to be added to the .resx file, you do NOT have the "add as link" option. The trick is to add the file (the one that is a resource for your project) first as a link to your project and making sure that the linked file is located in a folder named "Resources" that lives below the folder where your .resx file will live. Then, on your .resx file, choose add existing file and locate the file you originally linked in. Now, because Visual Studio will see that the file you are linking in is already a link in your project, it will use the linked when you build your project. (We accomplished this way back ~2005 using Visual Studio and I was able to to this again today using VS2019.

提交回复
热议问题