2017-11-11 14 views
0

xprojプロジェクトを構築しようとしていますが、間違ったディレクトリを探しているように見えるため、Microsoft.DotNet.Propsファイルを見つけることができません。xprojを構築するためにMicrosoft.DotNet.Propsディレクトリが存在しません

MSBuildExtensionsPath32ディレクトリMicrosoft\VisualStudio\..が存在しないC:\Program Files\dotnet\sdk\1.1.4\を参照するXMLを見てみると...しかし、通常のMSBuildのディレクトリC:\Program Files (x86)\MSBuildがMicrosoft.DotNet.PropsがここC:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props

ファイル用のディレクトリを持っていることの一部です。 XML

<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> 

<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> 

建物がある間、私が見るエラー:

error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.1.4\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. 

誰もが何が起こっているか任意のアイデアを持っている場合は、ヘルプは素晴らしい

EDIT次のようになります。

  • ビルドがWindows Server 2012 R2上のジェンキンスプロジェクトから呼び出されます。
  • VMイメージは、アップデート3のVisual Studio 2015コミュニティエディションに付属しているAzureマーケットプレイス「MicrosoftVisualStudio/VisualStudio/VS-2015-Comm-VSU3-AzureSDK-29-WS2012R2/2017.10.12」からのものです。 Azure SDK 2.9。古いv0.12からv8.xにノードをアップグレードしました。 1.1.4にインストールされたものがわからないため、.NETコアをアップグレードしました。
  • xproj自体にはコードはありません。スタティックファイル(ポストの下にあるコード)を提供するStartup.csのほんの少数を除いて。
  • このアプリケーションは、Service Fabricプロジェクトでも使用されます。エラーは.slnを構築することから来るのではなく、.sfprojをパッケージ化するとき(slnでビルドするように設定されていないかもしれませんが、パッケージはビルドする必要があります)。

Jenkins build steps

Startup.cs:

using System.IO; 
using Microsoft.AspNetCore.Builder; 
using Microsoft.AspNetCore.Hosting; 
using Microsoft.Extensions.Configuration; 
using Microsoft.Extensions.DependencyInjection; 
using Microsoft.Extensions.Logging; 

namespace Website 
{ 
    public class Startup 
    { 
     public Startup(IHostingEnvironment env) 
     { 
      var builder = new ConfigurationBuilder() 
       .SetBasePath(env.ContentRootPath) 
       .AddJsonFile("appsettings.json", true, true) 
       .AddJsonFile($"appsettings.{env.EnvironmentName}.json", true) 
       .AddEnvironmentVariables(); 
      Configuration = builder.Build(); 
     } 

     public IConfigurationRoot Configuration { get; } 

     // This method gets called by the runtime. Use this method to add services to the container. 
     public void ConfigureServices(IServiceCollection services) 
     { 
      // Add framework services. 
      services.AddMvc(); 
     } 

     // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 
     public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 
     { 
      loggerFactory.AddConsole(Configuration.GetSection("Logging")); 
      loggerFactory.AddDebug(); 

      if (env.IsDevelopment()) 
      { 
       app.UseDeveloperExceptionPage(); 
      } 
      else 
      { 
       app.UseExceptionHandler("/Home/Error"); 
      } 

      app.Use(async (context, next) => 
      { 
       await next(); 
       if (context.Response.StatusCode == 404 
        && !Path.HasExtension(context.Request.Path.Value)) 
       { 
        context.Request.Path = "/index.html"; 
        await next(); 
       } 
      }); 

      app.UseStaticFiles(); 
     } 
    } 
} 

編集:ここにあなたがして、プレビューツール(xproj)を使用しようとしている全体xprojのXML

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> 
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> 
    </PropertyGroup> 
    <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> 
    <PropertyGroup Label="Globals"> 
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> 
    <ProjectGuid>17107df8-0cfa-6946-917a-a9b8765cf9ea</ProjectGuid> 
    <RootNamespace>Website</RootNamespace> 
    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> 
    <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> 
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> 
    </PropertyGroup> 
    <PropertyGroup> 
    <SchemaVersion>2.0</SchemaVersion> 
    <IsServiceFabricServiceProject>True</IsServiceFabricServiceProject> 
    </PropertyGroup> 
    <ItemGroup> 
    <DnxInvisibleContent Include="bower.json" /> 
    <DnxInvisibleContent Include=".bowerrc" /> 
    </ItemGroup> 
    <ItemGroup> 
    <DnxInvisibleFolder Include="wwwroot\Angular\dist\" /> 
    </ItemGroup> 
    <ItemGroup> 
    <Service Include="{82a7f48d-3b69-4b1e-b82e-3ada8210c987}" /> 
    </ItemGroup> 
    <Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" /> 
</Project> 
+0

質問にはエラーを再現するのに十分な情報がありません。あなたの問題を再現できるようにする最小限のコードを投稿できます。さらに、plsはビルドの方法、プラットフォーム、インストールされたsdks、VSなどに関する情報を提供します。 –

+0

@JacekBlaszczynski元の投稿を今更新しました – Jjj

+0

コードを投稿していただきありがとうございます。あなたはプロジェクト全体のXMLとpkgproj、またはあなたのプロジェクトを構築するために使用できる何か同等のものを投稿できますか?時には、エラーが非常に深く埋もれていて、有益なエラーメッセージがない場合、特にmsbuildプロジェクトのデバッグは非常に難しく、特に重要ではありません。私は眠りにつくので、明日は答えます:) –

答えて

1

です1.1.4 .NETコアSDKのバージョン。 VS 2015で使用可能なプレビューツールは、.NET Coreの1.0+安定ツールでは機能しません。

.NET Core SDKのプレビュー2バージョンが開発マシンとJenkinsサーバーの両方にインストールされていることを確認してください。 1.0.0-preview2-003156 - とglobal.jsonファイルは、SDKのこのプレビュー版を使用するためにVSを伝えるために、ソリューションのディレクトリが存在すること:私は移行することで、安定したサポート.NETコアツールに移動をお勧めします長期的な解決策として

{ 
    "sdk": { 
    "version": "1.0.0-preview2-003156" 
    } 
} 

関連する問題