资源文件重新生成 [英] Resource file regenerating

查看:114
本文介绍了资源文件重新生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我遇到了一个问题,每次我添加一个资源,然后构建我的项目时,会添加一个名为Resources1.Designer的新资源文件.cs资源文件已经存在。



有谁知道为什么会这样?



谢谢George

Hi all,

I have been experiencing a problem whereby every time i add a resource and then build my project a new resource file is added called Resources1.Designer.cs when a resource file already exists.

Does anyone know why this might be?

Thanks George

推荐答案

您是否尝试过以下方法:

1)通过撤消结帐撤消更改(如果使用TFS),

2)清理解决方案,

3)重新启动Visual Studio

4)重试添加资源并重建
Have you tried below:
1)undoing the changes by undoing checkout (if using TFS),
2)clean the solution,
3)Restart Visual Studio
4)Retry adding resource and rebuild


打开csproj项目文件



找到以下标签: -

< EmbeddedResource Include =Resources \ Resources.resx> < Generator> ResXFileCodeGenerator< / Generator>

< LastGenOutput> Resources1.Designer.cs< / LastGenOutput>

< / EmbeddedResource>



然后将其更改为: -



< EmbeddedResource Include =Resources \ Resources.resx> < Generator> ResXFileCodeGenerator< / Generator>

< LastGenOutput> Resources.Designer.cs< / LastGenOutput>

< / EmbeddedResource>



希望这会对你有所帮助。 :)
Open csproj file of your project

Find the below tags:-
<EmbeddedResource Include="Resources\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources1.Designer.cs</LastGenOutput>
</EmbeddedResource>

Then change it to below:-

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

Hope this helps you. :)


尝试打开'Resources.Designer.cs',因为在视图中生成的代码 - 我相当肯定你会找到一种新的方式来访问资源:)< br $> b $ b

最好的问候

Espen Harlinn
Try opening the 'Resources.Designer.cs', as in view the generated code - I'm fairly certain you'll find a new way to access the resources :)

Best regards
Espen Harlinn


这篇关于资源文件重新生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆