2017-03-16 12 views
2

私はこの質問をGitHub/Microsoft/MSBuildに投稿しましたが、もっと広いコミュニティでこれについての初期の経験があることを期待しています。間違ったApp.Config publish.targets MSBuild 15

私はVS 2015(.NETコアプレビュー)からVS 2017と最新の.NETコアへのソリューション/プロジェクトの変換に取り組んでいます。

ソリューションはVisual Studio 2017で完全に正常に構築されますが、MSBuild 15(.NETコアプロジェクトのためv14を使用できません)を使用してビルドを実行しようとすると問題が発生します。 .configファイルをobj \ debug \ net452フォルダからコピーしようとすると失敗しますが、なんらかの理由で完全な.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からSitecore.Foundation.Commerce.Engine.csproj.code.exe.config

OUTPUTスニペットよう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参照のいずれかが互換性のないパッケージに依存していたが判明しました。これは順番に非常に奇妙な方法で明らかになった。

これは他の人には役に立たない場合は申し訳ありませんが、これは特定の問題を解決したようです。

関連する問題