2017-09-12 6 views
1

NET Standard 클래스 라이브러리와 일반 NET Framework 웹 응용 프로그램이 있습니다. 웹 응용 프로그램은 클래스 라이브러리를 참조합니다.Cake 빌드로 net-standard 라이브러리를 참조하는 Net Framework 웹 응용 프로그램을 만듭니다.

나는 Visual Studio 2017 Preview을 사용합니다.

나는 MSBuild 명령을 사용하여 Cake와 솔루션을 빌드 할 때 나는 지원되지 않는 프로젝트 메시지를 얻을 : 나는 DotNetCoreBuild를 사용하려고하면

error MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MS Build 2003 format.

내가 얻을 :

error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.0.2-vspre-006949\Microsoft\VisualStu dio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

을 그러나이 솔루션은 Visual Studio에 의해 성공적으로 구축되었습니다.

답변

1

최신 MSBuild 버전에는 NET Standard 라이브러리를 빌드 할 대상이 있습니다. 문제가 Visual Studio Preview 설치 경로에 있습니다 : CakeMSBuild을 찾을 수 없습니다.

MSBuildToolVersion에 지정하려고하면 오류가 발생합니다.

VS Preview과 작동 시키려면 MSBuild 실행 파일을 수동으로 지정해야합니다. @Gary 이완 공원으로

string msBuildPath = @"c:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\MSBuild\15.0\Bin\MSBuild.exe"; 

MSBuild("../NetStdExample.sln", new MSBuildSettings { 
    Verbosity = Verbosity.Minimal, 
    ToolPath = msBuildPath 
}); 

업데이트 : 최신 VS 설치를 결정하는 tool있다.

+1

경로를 하드 코딩하는 대신 여기 (https://cakebuild.net/blog/2017/03/vswhere-and-visual-studio-2017-support)를보고 싶을 수 있습니다. –

+0

@Michael, 여기서 솔루션을 공유해 주셔서 감사합니다. 답변을 표시해 주시면 같은 문제가있는 다른 커뮤니티 회원에게 도움이 될 것입니다. –