Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

75%
+4 −0
Q&A How to define custom configurations in new-style .csproj?

Problem I'm trying to update some projects from old-style .csproj: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.mi...

1 answer  ·  posted 3y ago by Peter Taylor‭  ·  last activity 2y ago by Peter Taylor‭

#1: Initial revision by user avatar Peter Taylor‭ · 2021-01-14T10:18:46Z (over 3 years ago)
How to define custom configurations in new-style .csproj?
### Problem

I'm trying to update some projects from old-style .csproj:

>     <?xml version="1.0" encoding="utf-8"?>
>     <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
>       etc.

to new-style:

>     <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
>       etc.

One group of projects has a custom configuration, in addition to the standard `Debug` and `Release`. After I convert a project from this group, VS gives an error message:

> Current solution contains incorrect configuration mappings. It may cause projects to not work correctly. Open the Configuration Manager to fix them. [Open Configuration Manager]

(where the square brackets represent a button). If I click the button, or open the configuration manager by other means, it updates the .sln file to use `Debug` instead of the custom configuration in the converted project.

### What I've tried

I've tried using the configuration manager to create a new configuration for the project, copying from Debug: this does absolutely nothing, not even an error dialog telling me that it can't do it.

I've tried adding a stanza to the converted .csproj to try to "define" the configuration:

>       <PropertyGroup Condition="'$(Configuration)' == 'Dev Cloud'">
>         <DefineConstants>TRACE;DEBUG;DEVCLOUD</DefineConstants>
>         <Optimize>false</Optimize>
>         <DebugType>full</DebugType>
>         <ErrorReport>prompt</ErrorReport>
>         <Prefer32Bit>true</Prefer32Bit>
>         <DebugSymbols>true</DebugSymbols>
>       </PropertyGroup>

This also fails to achieve anything.