2015-03-15 8 views
5

ich eine Klassenbibliothek mit dieser Eigenschaft Gruppen in den csproj Dateien habe:Build-Konfigurationen in csproj Datei

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 
    <PlatformTarget>AnyCPU</PlatformTarget> 
    <DebugSymbols>true</DebugSymbols> 
    <DebugType>full</DebugType> 
    <Optimize>false</Optimize> 
    <OutputPath>bin\Debug\</OutputPath> 
    <DefineConstants>DEBUG;TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    <Prefer32Bit>false</Prefer32Bit> 
    </PropertyGroup> 
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 
    <PlatformTarget>AnyCPU</PlatformTarget> 
    <DebugType>pdbonly</DebugType> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\Release\</OutputPath> 
    <DefineConstants>TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 

Wenn ich dieses Projekt in einer Lösung aufzubauen, die Konfiguration unter einer othe Build baut andere als ‚Debug‘ oder 'Release' der Build wird für dieses Projekt fehlschlagen, weil es keine korrekte Build-Konfiguration finden wird.

Gibt es eine Möglichkeit, eine Standard-Build-Konfiguration zu definieren, die auch dann ausgeführt wird, wenn keine der Bedingungen erfüllt ist?

+0

Bauen + Configuration Manager. Wählen Sie die Konfiguration in der oberen linken Combobox. Wählen Sie die bestimmte Konfiguration, die Sie für Ihr Projekt erstellen möchten. Ihre Wahl wird für zukünftige Builds in Erinnerung bleiben. –

Antwort

8

Fügen Sie einfach diese Definition:

<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> 
    <PlatformTarget>AnyCPU</PlatformTarget> 
    <DebugType>pdbonly</DebugType> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\Release\</OutputPath> 
    <DefineConstants>TRACE</DefineConstants> 
    <ErrorReport>prompt</ErrorReport> 
    <WarningLevel>4</WarningLevel> 
    </PropertyGroup> 
Verwandte Themen