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

Dashboard
Notifications
Mark all as read
Q&A

How to define custom configurations in new-style .csproj?

+1
−0

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.

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comments

0 answers

Sign up to answer this question »