問題描述
將我的項(xiàng)目升級(jí)到 Visual Studio 2010 和 .Net 4.0 后,我的 app.config 文件會(huì)在構(gòu)建項(xiàng)目時(shí)生成以下消息:
After upgrading my project to Visual Studio 2010 and .Net 4.0, my app.config file generates these messages upon building the project:
- 找不到元素supportedRuntime"的架構(gòu)信息.
- 找不到屬性版本"的架構(gòu)信息.
- 找不到屬性sku"的架構(gòu)信息.
這是我的整個(gè) 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>
如果我創(chuàng)建一個(gè)新的 VS2010 項(xiàng)目并從字面上復(fù)制/粘貼相同的 app.config 文件,我不會(huì)收到此類消息.
If I create a new VS2010 project and literally copy/paste the same app.config file, I receive no such messages.
顯然這些消息不會(huì)導(dǎo)致任何運(yùn)行時(shí)問題,但它們?nèi)匀涣钊藷篮筒话?
Obviously these messages are not causing any runtime problems, but they are still annoying and disconcerting.
如何解決導(dǎo)致這些消息出現(xiàn)的問題?
How do I fix whatever problem is making these messages appear?
我在 app.config configSections 看到了答案自定義設(shè)置找不到架構(gòu)信息,但是我在屬性列表中看不到任何地方輸入架構(gòu)的路徑.
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.
謝謝.
推薦答案
我將架構(gòu)從 DotNetConfig 更改為 DotNetConfig35,它解決了這個(gè)問題.這在 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 文件會(huì)給出文件的屬性,在 app.config 文件本身的編輯窗口中右鍵單擊會(huì)給出 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.
這篇關(guān)于app.config “找不到架構(gòu)信息"轉(zhuǎn)換為 Visual Studio 2010/.Net 4.0 后的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!