开发者

Asp.net MVC 2 Localization Problem in dev

I work on a multi culture web project. I use Localize and Global Ressources(resx) as multilang technology.

I work in team with 2 developer. How can we share .resx . When my teammate give me the 2 Files ( myfile.resx and myfile.Designer.cs) and I incl开发者_Go百科ude it in my project, there is no way i can add some new string in the file. The new string seem to not be copy in the myfile.Designer.cs ...

I Miss something here.

I Use Asp.net MVC 2


If you are just manually adding an existing RESX and its designer file to your project then you might have to manually connect them together so that VS knows they are related. You will have to manually edit your .csproj file. Here's an example of how to connect the two:

<ItemGroup>
  <Compile Include="Resources\MyResources.Designer.cs">
    <AutoGen>True</AutoGen>
    <DesignTime>True</DesignTime>
    <DependentUpon>MyResources.resx</DependentUpon>
  </Compile>
</ItemGroup>
<ItemGroup>
  <EmbeddedResource Include="Resources\MyResources.resx">
    <Generator>ResXFileCodeGenerator</Generator>
    <LastGenOutput>MyResources.Designer.cs</LastGenOutput>
    <SubType>Designer</SubType>
  </EmbeddedResource>
</ItemGroup>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜