Visual Basic .NET中使用CodeDOM编译器的设置和资源 [英] Settings and Resources with CodeDOM compiler in Visual Basic .NET
问题描述
您好,
以下问题使我无法在Visual Basic中完成项目。我必须说,经过多天的搜索,我没有找到任何关于这个主题的内容。
你们中的许多人可能都熟悉Visual Studio中提供的CodeDOM编译器。使用不同的用户输入变量编译应用程序可能非常简单。
但是,此应用程序需要在项目设置选项卡中保存一些字符串,并使用My.Settings通过代码访问。 < settingname>"句法。 My.Resources也是如此。
现在,对于Visual Studio编译的应用程序,通过资源或设置选项卡很容易,但是,如果我在Visual Studio中创建的应用程序应该使用codedom另一个应用程序,其代码包含My.Settings语句,我似乎无法创建它。用我的应用程序编译它时,我得到设置不是我的成员。
任何解决方案?有人可以告诉我这个问题吗?这肯定是一件容易的事情,但我似乎无法找到。
Hello,
The following problem keeps me from finalizing my project in Visual Basic. I must say that after many days of search, I did not find anything regarding this topic.
Many of you are probably familiar with the CodeDOM compiler available in Visual Studio. Compiling applications with different user-inputed variables can be quite an easy task.
However, this application requires a few strings saved in the project settings tab and accessed via code by using the "My.Settings.<settingname>" syntax. The same stands for My.Resources.
Now, for a Visual Studio compiled application, it's easy, via the Resources or Settings tab, but, if the application I make in Visual Studio is supposed to compile with codedom another application whose code includes My.Settings statement, I can't seem to be able to create it. When compiling it with my application, I get "Settings is not a member of My".
Any solutions? Could anybody enlighten me about this problem? It's most certainly something easy, but I can't seem to find.
推荐答案
在编译时生成了Settings类(就像很多其他的My。项一样)时间。
我是一个命名空间,您必须运行Settings类生成器,或者生成您自己的Settings类并将其添加到My命名空间以使其可用。查看代码隐藏设置,了解编译器如何生成此类。
The Settings class (like a lot of the other My. items) are generated at compile time.
My is a namespace, you would have to run the Settings class generator, or generate your own Settings class and add it to the My namespace for it to be available. Take a look at your settings code-behind to find out how the compiler generates this class.
这篇关于Visual Basic .NET中使用CodeDOM编译器的设置和资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!