Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
922 views
in Technique[技术] by (71.8m points)

c# - Fix: The Global element 'configuration' has already been declared

I used the second solution of How to resolve "Could not find schema information for the element/attribute <xxx>"?

I.e. created a XSD with the button to create a scheme. I changed the stylesheet in app.config to app.xsd but now I get the warning:

The Global element 'configuration' has already been declared in app.xsd

Even when changing the name the warning is shown. Does anybody have a solution for this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Rebooting didn't work for me, so I'd like to share what did work.

First, I just upgraded to Windows 8. This problem didn't occur before then. And this issue only happened in one of my app.config files. So I decided to compare the problematic app.config with a good one. In Visual Studio, with the app.config open, I went to Xml -> Schemas. I noticed that the good config only had three of these schemas checked. The bad one had the same three checked, plus a DotNetConfig.xsd. After I changed the Use column to automatic, for DotNetConfig.xsd, the problem went away.

enter image description here

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...