我正在使用Visual Studio 14(VS 2015)Update 3,我想使用Kestrel作为服务器构建基于.Net Core 1的REST API.
我希望能够使用.csproj而不是旧的.xproj,以便像在其他项目中一样使用MSBuild.为此,我使用了他们的教程.
问题是,当我将"OutputPath"定义为"bin\Debug"(例如,对于Debug模式)时,Visual Studio构建项目并将构建结果设置为"bin\Debug \\ bin\Debug \netcoreapp1.0\win7 -x64" .
如果我使用.xproj和build,结果存储在"bin\Debug \netcoreapp1.0"中,这是预期的行为.
怎么了?
.csproj的:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<BaseNuGetRuntimeIdentifier>win7</BaseNuGetRuntimeIdentifier>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<NoStdLib>true</NoStdLib>
<NoWarn>$(NoWarn);1701</NoWarn>
<ProjectGuid>{D21ABA46-65F9-4B47-882C-F9C0765052DD}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MyAPP</RootNamespace>
<AssemblyName>MyAPP</AssemblyName>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<IntermediateOutputPath>.\obj\Debug</IntermediateOutputPath>
<OutputPath>.\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> …Run Code Online (Sandbox Code Playgroud)