Visual Studio 的 C# 设置错误

发布于 2024-11-07 12:40:28 字数 1085 浏览 4 评论 0原文

当我尝试构建应用程序时,我在处理设置时遇到 3 个错误。我像往常一样完成了设置,但是这次我遇到了错误,并且不知道为什么。

这是设置文件代码:

<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="SAM.Properties" GeneratedClassName="Settings">
  <Profiles />
  <Settings>
    <Setting Name="AllowGlass" Type="DevExpress.Utils.DefaultBoolean" Scope="User">
      <Value Profile="(Default)">True</Value>
    </Setting>
    <Setting Name="ApplicationSkinName" Roaming="true" Type="System.String" Scope="Application">
      <Value Profile="(Default)" />
    </Setting>
  </Settings>
</SettingsFile>

这是我得到的错误:

Error   1   Too many characters in character literal    1   15  SAM
Error   2   Too many characters in character literal    1   30  SAM
Error   3   A namespace cannot directly contain members such as fields or methods   1   1   SAM

我再次完全不知道为什么会收到这些错误。因此,任何帮助,无论多么小,我都会非常感激。

When I try to build application I get 3 errors dealing with the settings. I've done the settings the same as I always do, but this time I'm getting errors and don't know why.

Here's the settings file code:

<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="SAM.Properties" GeneratedClassName="Settings">
  <Profiles />
  <Settings>
    <Setting Name="AllowGlass" Type="DevExpress.Utils.DefaultBoolean" Scope="User">
      <Value Profile="(Default)">True</Value>
    </Setting>
    <Setting Name="ApplicationSkinName" Roaming="true" Type="System.String" Scope="Application">
      <Value Profile="(Default)" />
    </Setting>
  </Settings>
</SettingsFile>

And here is the errors I get:

Error   1   Too many characters in character literal    1   15  SAM
Error   2   Too many characters in character literal    1   30  SAM
Error   3   A namespace cannot directly contain members such as fields or methods   1   1   SAM

Again I have absolutely no idea why I'm getting these errors. So any help no matter how small will be greatly appreciated by me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一曲爱恨情仇 2024-11-14 12:40:28

文件的构建操作是否设置为Compile?如果是,请设置为None后重试。

Is build action of file is set to Compile? If yes, try again after setting it to None.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文