Is there a way to make Strongly Typed Resource files public (as opposed to internal)?

吃可爱长大的小学妹 提交于 2019-12-01 02:12:44

Not sure which version of Visual Studio you are using, so I will put steps for either one:

VS 2008 - When you open the resx file in design view, there is an option at the top beside Add Resource and Remove Resource, called Access Modifier, it is a drop down where you can change the generated code from internal to public.

VS 2005 - You don't have the option to generate the code like in VS 2008. It was a feature that was added, because of this headache. There are work around's though. You could use a third party generator like this tool or you could use the InternalsVisibleTo attribute in your AssemblyInfo.cs to add the projects that will have access to the internal classes of your resource library.

Visual Studio 2008 allows you to select whether the generated resource class should be internal or public. There is also the ResXFileCodeGeneratorEx, which should do that for Visual Studio 2005.

From the dataset designer and with the properties window visible, there is a "Modifier" property. For your datasets, it is likely saying internal.

I don't know if there is a setting to default all new datasets to public.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!