app.config “找不到架构信息"转换为 Visual Studio 2010/.Net 4.0 后 [英] app.config "Could not find schema information" after converting to Visual Studio 2010 / .Net 4.0

查看:17
本文介绍了app.config “找不到架构信息"转换为 Visual Studio 2010/.Net 4.0 后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将我的项目升级到 Visual Studio 2010 和 .Net 4.0 后,我的 app.config 文件会在构建项目时生成以下消息:

After upgrading my project to Visual Studio 2010 and .Net 4.0, my app.config file generates these messages upon building the project:

  • 找不到元素supportedRuntime"的架构信息.
  • 找不到属性版本"的架构信息.
  • 找不到属性sku"的架构信息.

这是我的整个 app.config 文件:

Here is my entire app.config file:

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
  </startup>
</configuration>

如果我创建一个新的 VS2010 项目并从字面上复制/粘贴相同的 app.config 文件,我不会收到此类消息.

If I create a new VS2010 project and literally copy/paste the same app.config file, I receive no such messages.

显然这些消息不会导致任何运行时问题,但它们仍然令人烦恼和不安.

Obviously these messages are not causing any runtime problems, but they are still annoying and disconcerting.

如何解决导致这些消息出现的问题?

How do I fix whatever problem is making these messages appear?

我在 app.config configSections 看到了答案自定义设置找不到架构信息,但是我在属性列表中看不到任何地方输入架构的路径.

I see the answer at app.config configSections custom settings can not find schema information, but I see nowhere in the properties list to enter the path to the schema.

谢谢.

推荐答案

我将架构从 DotNetConfig 更改为 DotNetConfig35,它解决了这个问题.这在 app.config 文件的属性中可用.

I changed the schema from DotNetConfig to DotNetConfig35 and it took care of the issue. This is available in the properties of the app.config file.

在解决方案资源管理器中右键单击 app.config 文件会给出文件的属性,在 app.config 文件本身的编辑窗口中右键单击会给出 XML 文档的属性.

Right clicking the app.config file in solution explorer gives the properties of the file, right clicking in the edit window of the app.config file itself gives the properties of the XML document.

这篇关于app.config “找不到架构信息"转换为 Visual Studio 2010/.Net 4.0 后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆