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
203 views
in Technique[技术] by (71.8m points)

c# - Rebuilding app.config in visual studio?

My app.config was giving me several messages related to "usersettings schema not found", so I deleted it with the intention of building it from scratch, but I was not successful. How can I build a new one based on my settings file? Whenever I make a new one and build the solution, it doesn't build the app config file. I don't know what else to try.

Here's the troublesome part of my old file:

<startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<userSettings>
    <DelocksNote.Settings1>
        <setting name="Font" serializeAs="String">
            <value>DejaVu Sans, 20.25pt, style=Italic</value>
        </setting>
        <setting name="WordWrap" serializeAs="String">
            <value>False</value>
        </setting>
    </DelocksNote.Settings1>
</userSettings>
See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

For anyone visiting in the future...

Delete the app.config file in your solution explorer. Right click the project and select add, add new item. Find "Application Configuration File" in the list and add it. It will be empty.

To generate the contents based on your settings (which should still be in tact): edit a setting (make a space or something) and save. Then go look at your new app.config file. It will be re-built!


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

...