Referencing resource files from multiple projects in a solution

前端 未结 3 1941
借酒劲吻你
借酒劲吻你 2021-02-04 16:08

I am working on localization for a asp.net application that consists of several projects.

For this, there are some strings that are used in several of these projects. Na

3条回答
  •  生来不讨喜
    2021-02-04 16:45

    I have used this solution before to share a assembley info.cs file across all projects in a solution I would presume the same would work fro a resource file.

    Create a linked file to each individual project/class library. There will be only one copy and every project will have a reference to the code via a linked file at compile time. Its a very elegant solution to solve shared non public resources without duplicating code.

    
      filename for Visual Studio To Dispaly.resx
    
    

    add that code to the complile item group of a csproj file then replace the paths with your actual paths to the resx files and you sould be able to open them.

    Once you have done this for one project file you should be able to employ the copy & paste the linked file to other projects without having to hack the csproj.

提交回复
热议问题