2017-03-16 13 views
2

나는이 질문을 GitHub/Microsoft/MSBuild에 올렸지 만, 더 넓은 커뮤니티가이 일찍 경험을 쌓았기를 바라고 있습니다.잘못된 App.Config publish.targets MSBuild 15

VS 2015 (.NET 코어 미리보기)에서 솔루션/프로젝트를 VS 2017 및 최신 .NET 코어로 변환하는 중입니다.

솔루션은 이제 Visual Studio 2017에서 완벽하게 훌륭하게 빌드되지만 MSBuild 15 (.NET 핵심 프로젝트로 인해 v14를 사용할 수 없음)를 사용하여 빌드를 실행하려고하면 문제가 발생합니다. obj \ debug \ net452 폴더에서 .config 파일을 복사하려고하면 오류가 발생하지만 어떤 이유로 전체 .csproj 이름이 추가됩니다.

문제는 Publish.Targets가 .config 파일로 이상한 일을하고 있다는 것입니다. .

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Publish.targets(128,5): 
error MSB3030: Could not copy the file "obj\Debug\net452\Sitecore.Foundation.Commerce.Engine.csproj.code.exe.config" because it was not found. 

[C:\Projects\Sitecore.Demo.Retail\src\Foundation\Commerce\Engine\code\Sitecore.Foundation.Commerce.Engine.csproj] 

AssemblyName을 사용하는 대신 구성 파일의 이름 앞에 전체 프로젝트 이름 (.csproj 포함)을 붙입니다.

이 경우 Sitecore.Foundation.Commerce.Engine.csproj는 프로젝트이며 코드는 AssemblyName입니다 (결국 더 나은 것으로 이름이 바뀜). 보시다시피 "Sitecore.Foundation.Commerce.Engine.csproj.code.exe.config"가 존재하지 않습니다. code.exe.config는 존재합니다.

저에게 GitHub 레포 액세스 권한을 부여해 주셔서 감사합니다. 저장소에 공개하지 못하도록 막아 주시면 기꺼이 도와 드리겠습니다. MSBuild에서에서

그래서 code.exe.config가 Sitecore.Foundation.Commerce.Engine.csproj.code.exe.config

으로 해결

출력 미리보기 : 여기

08:13:09.957  1>Target "GenerateBindingRedirectsUpdateAppConfig: (TargetId:127)" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\Projects\Sitecore.Demo.Retail\src\Foundation\Commerce\Engine\code\Sitecore.Foundation.Commerce.Engine.csproj" (target "ResolveReferences" depends on it): 
        Set Property: AppConfig=obj\Debug\net452\Sitecore.Foundation.Commerce.Engine.csproj.code.exe.config 
        Added Item(s): 
         AppConfigWithTargetPath= 
          obj\Debug\net452\Sitecore.Foundation.Commerce.Engine.csproj.code.exe.config 
            TargetPath=code.exe.config 

는 Sitecore.Foundation입니다 .Commerce.Engine.csproj 콘텐츠 :

<?xml version="1.0" encoding="utf-8"?> 
<Project Sdk="Microsoft.NET.Sdk.Web" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 

    <PropertyGroup> 
    <TargetFramework>net452</TargetFramework> 
    <PreserveCompilationContext>false</PreserveCompilationContext> 
    <AssemblyName>code</AssemblyName> 
    <OutputType>Exe</OutputType> 
    <PackageId>code</PackageId> 
    </PropertyGroup> 

    <!--<ItemGroup> 
    <None Update="wwwroot\**\*"> 
     <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> 
    </None> 
    </ItemGroup>--> 

    <ItemGroup> 
    <ProjectReference Include="..\..\legacyCommerce\Plugin.Sample.Habitat\Plugin.Sample.Habitat.csproj" /> 
    <ProjectReference Include="..\..\legacyCommerce\Plugin.Sample.Payments.Braintree\Plugin.Sample.Payments.Braintree.csproj" /> 
    <ProjectReference Include="..\..\legacyCommerce\Sitecore.Commerce.Plugin.AdventureWorks\Sitecore.Commerce.Plugin.AdventureWorks.csproj" /> 
    </ItemGroup> 

    <ItemGroup> 
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.2" /> 
    <PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" /> 
    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" /> 
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" /> 
    <PackageReference Include="Microsoft.AspNetCore.OData" Version="6.0.0-alpha1-rtm-121216" /> 
    <PackageReference Include="Microsoft.ApplicationInsights" Version="2.1.0" /> 
    <PackageReference Include="Serilog" Version="2.4.0" /> 
    <PackageReference Include="Sitecore.Commerce.Core" Version="1.0.2301" /> 
    <PackageReference Include="Serilog.Sinks.Literate" Version="2.1.0" /> 
    <PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" /> 
    <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" /> 
    <PackageReference Include="Serilog.Extensions.Logging" Version="1.4.0" /> 
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="1.0.2" /> 
    <PackageReference Include="Sitecore.Commerce.Provider.FileSystem" Version="1.0.2301" /> 
    <PackageReference Include="Sitecore.Framework.Rules" Version="1.1.12" /> 
    <PackageReference Include="Sitecore.Framework.Rules.Serialization" Version="1.1.12" /> 
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" /> 
    <PackageReference Include="Sitecore.Framework.Diagnostics" Version="1.1.4" /> 
    </ItemGroup> 

    <ItemGroup Condition=" '$(TargetFramework)' == 'net452' "> 
    <Reference Include="System" /> 
    <Reference Include="Microsoft.CSharp" /> 
    </ItemGroup> 

</Project> 
+0

GitHub 문제에 대한 링크 : https://github.com/Microsoft/msbuild/issues/1873 – jflsitecore

답변

0

그것은 우리의 NuGet 참조 중 하나가 호환되지 않는 패키지에 대한 종속성을했다 밝혀졌습니다. 이것은 차례 차례로 매우 이상한 방법으로 나타났다.

다른 사람에게 도움이되지 않는다면 유감이지만 문제가 해결 된 것으로 보입니다.