2017-01-03 72 views
2

安裝我在與我建立應用程序asnetcore問題的新的VS 2017年RC之後,這裏是我收到的錯誤:無法生成aspnetcore應用在2017年VS RC

MSB4131的「FilesWritten GenerateRuntimeConfigurationFiles‘任務「參數不被支持 ’。驗證該任務上的參數 ,它是一個可獲取的公共實例屬性。

這裏是我的.csproj文件:

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web"> 
    <PropertyGroup> 
    <OutputType>Exe</OutputType> 
    <TargetFramework>net462</TargetFramework> 
    <PreserveCompilationContext>true</PreserveCompilationContext> 
    </PropertyGroup> 
    <PropertyGroup Condition="'$(TargetFramework)' == 'net462'"> 
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier> 
    </PropertyGroup> 
    <PropertyGroup> 
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback> 
    </PropertyGroup> 
    <PropertyGroup> 
    <UserSecretsId>aspnet-HobbyQuarters.Web-e309acfb-31ce-4333-a350-edb5d1c073d3</UserSecretsId> 
    </PropertyGroup> 
    <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.0'"> 
    <PackageReference Include="Microsoft.NETCore.App"> 
     <Version>1.0.1</Version> 
    </PackageReference> 
    <PackageReference Include="System.ComponentModel.Annotations" Version="4.3.0" /> 
    </ItemGroup> 
    <ItemGroup> 
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.AspNetCore.Owin" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink.Loader" Version="14.1.0" /> 
    <PackageReference Include="Nancy"> 
     <Version>2.0.0-barneyrubble</Version> 
    </PackageReference> 
    </ItemGroup> 
    <ItemGroup> 
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.0" /> 
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.0.0-msbuild2-final" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Reference Include="System" /> 
    <Reference Include="System.Data" /> 
    <Reference Include="System.Xml" /> 
    <Reference Include="System.Xml.Linq" /> 
    <Reference Include="Microsoft.CSharp" /> 
    <Reference Include="System.ComponentModel.DataAnnotations" /> 
    </ItemGroup> 
    <ItemGroup> 
    <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.0.0-msbuild2-final" /> 
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild2-final" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Folder Include="Tasks\" /> 
    </ItemGroup> 
</Project> 
+0

看起來像一個SDK問題https://github.com/dotnet/sdk/issues/482 – Set

回答

0

所以看起來這是涉及到具有不同的MSBuild工具版本的多個項目。

我有沒有使用引用該工具的新的慣例,舊項目:ToolsVersion =「15.0」 SDK =「Microsoft.NET.Sdk.Web」 ......

有一次,我改變了他們使用這個會議一切都開始奏效。

1
  1. 啓動任務管理器
  2. 結束所有現有的MSBuild任務。
  3. 重建您的項目。它應該工作得很好。

旁邊。你的.csproj對我來說看起來很好,但是,它看起來像其設置在兩個不同的環境中運行,也許控制檯和aspcore 1.0