简体   繁体   中英

Visual Studio 2019 with C#: Deactivation of "Optimize code" crashes my project

I Visual Studio 2019 with C#.

I try to deactivate "Optimize Code" for a Release build in the project settings.

But if I deactivate this feature I can not reopen my solution anymore, when I start Visual Studio I get this error:

An error occurred in 'Solution 'Test' (14 of 14 projects)' while attempting to open 'Test'

The document 'D:\Data\Source\tests\test\test.csproj' is already open as a project or a solution and cannot be opened in an editor at this time.

How can I deactivate "Optimze code" without this error?

I have tried most of the suggested solutions the Ihave found for this error message, like deleting.suo file or remove and add the project... but none worked.

You can edit the csproj directly - it is just xml. If this is a new-style SDK csproj, then you're looking for:

<Optimize>false</Optimize>

or

<Optimize>true</Optimize>

However, it sounds more like a hung background process somewhere causing problems. I hate to say it but: have you tried turning it off and on again?

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