类型或命名空间名称'属性'不存在
问题说明
我想在我的项目中使用应用程序设置。
I'm trying to use application settings in my project.
当我尝试在项目下面的代码行,我得到一个错误。
When I try the following line of code in the project, I get an error.
TransferLogs.Properties.Settings.Default.ValleyLastRun = timeNow;
由此产生的错误是:
类型或命名空间名称'属性'不存在命名空间'Williams.TransferLogs存在(是否缺少程序集引用?)
The type or namespace name 'Properties' does not exist in the namespace 'Williams.TransferLogs' (are you missing an assembly reference?)
我定义为我的项目 - >属性 - >设置页面上的日期时间设置ValleyLastRun。我不知道我为什么不能引用我的项目设置
I have the setting "ValleyLastRun" defined as a DateTime on my Project->Properties->Settings page. I don't know why I can't reference the setting in my project.
下面是解决方案的窗口:
Here's the solution window:
正确答案
的问题与您的资源文件。每默认的设置为内部产生的。您可以更改上面的设置下拉框。
The problem is related to your resource file. Per default the settings are generated as internal. You can change that in the dropdown box above the settings.
有有时这个类的构造函数的一个问题,因为它仍然是内部的。您可以手动更改,但设置的每个编辑之后将被重置为内部。
There is sometimes a problem with the constructor of this class because it remains internal. You can change that manually but after every edit of the Settings it will be reset to internal.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcfecbe
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
检查邮件是否发送成功
it1352 07-25 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20