one resource file for two projects in one solution
-
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.
-
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.
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 -
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