Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3356670
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:32:27+00:00 2026-05-18T02:32:27+00:00

I have one resx file and I want to use it from several solutions\projects

  • 0

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 there some way to do so ? Because when i add it as “Add existing file” it copies me a copy locally.

Any idea how to do so ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:32:27+00:00Added an answer on May 18, 2026 at 2:32 am

    If you’re using a .resx file, you probably want to take advantage of the auto-generated code functionality that Visual Studio provides for .resx files. If you’re including a .resx file in multiple projects, then you may want to have each project auto-generate its own code. You might do this because you want to use a different code generator for certain projects (ResXCodeFileGenerator vs. GlobalResourceProxyGenerator) or you might just want the namespace of the generated code to be aligned with the project. Here’s how you can set that up.

    I’ve set up a new solution with a C# console application project called SharedResx. I’ve also added a C# class library project to the solution called Resources, and within that project I added a new resource file named MySharedResource.resx. Visual Studio automatically creates a MySharedResource.Designer.cs file within my Resources project with the code inside of the Resources namespace.

    First, include your existing .resx file in the SharedResx console application project as a link, as other answers have mentioned. Add Existing Item -> find ..\Resources\MySharedResource.resx -> use the drop down list on the Add button to select “Add as Link”.

    Next, you’ll have to manually modify the project file to set up auto-generation. You can look at the Resources.csproj to see how the auto-generation is set up there as a guide for how it should look in SharedResx.csproj.
    Right-click on the SharedResx project and select Unload Project. Right-click again and select Edit SharedResx.csproj.
    Scroll down to find the EmbeddedResource element that corresponds to your linked .resx file:

    <EmbeddedResource Include="..\Resources\MySharedResource.resx">
      <Link>MySharedResource.resx</Link>
    </EmbeddedResource>
    

    Modify this to include a Generator element and a LastGenOutput element:

    <EmbeddedResource Include="..\Resources\MySharedResource.resx">
      <Link>MySharedResource.resx</Link>
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>SharedResx.MySharedResource.Designer.cs</LastGenOutput>
    </EmbeddedResource>
    

    Note: manual editing is only necessary if you want to control the name of the generated file as I’ve done in my example. Otherwise, you can specify the Generator element using the Custom Tool setting in the Properties window in Visual Studio.

    Also note that in the LastGenOutput element I’ve named the generated file with the SharedResx project name as a prefix. This will cause the ResXFileCodeGenerator to create a file named SharedResx.MySharedResource.Designer.cs in the same folder as the .resx file. I’ve experimented with specifying a relative path rather than just a file name in the LastGenOutput element in order to get the generated file to be in a different folder, such as the SharedResx folder, but I found that it didn’t work consistently. While I was able to generate the file in the correct location the first time, the LastGenOutput element lost its value so that subsequent generations would not target that same location. I gave up on that and just used the project name prefix as part of the file name in order to avoid possible conflicts with other projects.

    Now, close the SharedResx.csproj file and right-click again to select Reload Project. Right-click on the linked MySharedResource.resx file in the SharedResx project and select Run Custom Tool. You should now see that a new linked file named SharedResx.MySharedResource.Designer.cs was added to the project as a nested file under the MySharedResource.resx file. You may have to turn on the “Show All Files” option in the Solution Explorer window in order to see it.

    You now have a code file auto-generated from your shared .resx file included in your project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one repo hosted at https://github.com/aikiframework/json . On my local copy, I added
Here comes again, I have managed to collect specific data from resx file (xml)
I have a solution with more then one projects. Is there a way i
I need to serialize the strings from a resource file (.resx) into a JSON
I have a Web solution which contains two projects ( A and B )
I'm creating WebResources.resx file with several string messages I'd like to categorize: Signup_Status_Inactive Signup_Status_Reserved
We use resx files to localize our web applications. We usually create local resx
I am storing a set of values in a resource file (resx) and have
I wanted to create an XML File from Resouce File(.resx). I succeeded in that
I have a system.resx resources file that is used in a SubmitClick method Protected

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.