在开发Silverlight应用程序和使用项目资源(.resx)时,我遇到了Visual Studio 2010的一些奇怪行为
每次我更改资源时,它都会在后面的代码中将自己设置为内部而不是公共,尽管我可以在设计模式中看到它设置为公共它不是.
知道如何解决这个问题吗?
我不知道这是否只影响Silverlight项目或一般所有C#项目.
解决方法:
此链接可能有所帮助.
它说:
Turns out there’s a flaw in the VS
build action logic here; unfortunately
changing this tool action will NOT
flip the access level of the class
constructor from internal to public
(at least not for a strongly typed
language). A public constructor is
another requirement of Silverlight
XAML usage of a class. You will have
to do this yourself manually in the
designer.cs file.
希望这可以帮助
编辑:-
这是另一个http://www.wintellect.com/CS/blogs/jprosise/archive/2010/06/21/dynamic-localization-in-silverlight.aspx说的
Finally, Visual Studio suffers from a
long-standing bug that leaves the
constructor of the ResourceManager
wrapper class it generates marked
internal when you change the class’s
access modifier to public. This means
that whenever you modify the primary
RESX file, forcing a code regen, you
have to manually change internal to
public on the constructor in the
generated code. It beats me why this
hasn’t been fixed after all these
years, but it hasn’t.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。