Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. one resource file for two projects in one solution

one resource file for two projects in one solution

Scheduled Pinned Locked Moved C#
questionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shakhtyor
    wrote on last edited by
    #1

    Hello, I have two projects (say proj1 and proj2) that are part of one solution. Both of them need to access a resource (.resx) file, which I can only add to one of the projects (say, to proj2). Is there a more graceful way of accessing this resource file (or making it common to both projects) than explicitly loading the assembly that references the .resx file into the one that doesn't? Thank you.

    P 1 Reply Last reply
    0
    • S shakhtyor

      Hello, I have two projects (say proj1 and proj2) that are part of one solution. Both of them need to access a resource (.resx) file, which I can only add to one of the projects (say, to proj2). Is there a more graceful way of accessing this resource file (or making it common to both projects) than explicitly loading the assembly that references the .resx file into the one that doesn't? Thank you.

      P Offline
      P Offline
      Phillip M Hoff
      wrote on last edited by
      #2

      You should be able to include the common resource file in each project, though you may have to do this by hand-editing the project files (.csproj). For example, if both projects are at a peer level, with the resource file in a parent folder, you could include them in the project files like so: <Compile Include="Properties\Settings.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> <EmbeddedResource Include="..\Resource1.resx"> <SubType>Designer</SubType> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>..\Resource1.Designer.cs</LastGenOutput> </EmbeddedResource> -Phil

      S 1 Reply Last reply
      0
      • P Phillip M Hoff

        You should be able to include the common resource file in each project, though you may have to do this by hand-editing the project files (.csproj). For example, if both projects are at a peer level, with the resource file in a parent folder, you could include them in the project files like so: <Compile Include="Properties\Settings.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> <EmbeddedResource Include="..\Resource1.resx"> <SubType>Designer</SubType> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>..\Resource1.Designer.cs</LastGenOutput> </EmbeddedResource> -Phil

        S Offline
        S Offline
        shakhtyor
        wrote on last edited by
        #3

        Excellent! I just tried your solution and it works (not being able to edit the projects' properties in the designer view is a bummer, but editing them manually does the trick). Thank you, Phil! Vladimir

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups