简体   繁体   中英

Converting console application from 4.5.1 to 3.5 in visual studio causes the console App.config to no longer be picked up

I have a Console project that was created targeting .Net 4.5.1 that needs to be re-targeted to .Net 3.5.

When I re-target in Visual Studio 2013, the original config file is no longer picked up.

The old App.config also start throwing random warnings about seemingly unrelated things such as:

"The simpleType 'small_boolean_Type' has already been declared"

This element isn't present in the config file and pretty much all other warnings similarly reference properties that are not in the config.

How can I fix the config file after re-targeting my Console Application?

Create a new config file, by creating a Console Application in Visual Studio that targets .Net 3.5. Then copy that config file over to your downgraded project. Copy over any app specific settings you need and you should be fine.

Seemingly, it didn't like the following element I had inside of an endpoint behavior:

 <webHttp faultExceptionEnabled="true" defaultOutgoingResponseFormat="Json"/>

Removing the node fixed the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM