Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

A2spa.xproj(8,3): Getting error MSB4019: ... Microsoft.DotNet.Props" was not found? #454

Closed
ghost opened this issue Nov 21, 2016 · 9 comments

Comments

@ghost
Copy link

ghost commented Nov 21, 2016

Hi. Great idea...

$yo aspnetcore-spa

Looking for additional install/prereq required since I'm always getting this error during spa-creation and upon "dotnet run"

C:\Users\admin\Documents\Visual Studio 2017\Projects\aspnetcorespa\A2spa.xproj(8,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-preview3-004056\Extensions\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Indeed, this file is not there on Windows 10, Visual Studio 2015 (and 2017 RC1) installed.

@ghost ghost changed the title Getting error MSB4019: ... Microsoft.DotNet.Props" was not found? A2spa.xproj(8,3): Getting error MSB4019: ... Microsoft.DotNet.Props" was not found? Nov 21, 2016
@ghost ghost closed this as completed Nov 21, 2016
@ghost ghost reopened this Nov 21, 2016
@ghost
Copy link
Author

ghost commented Nov 21, 2016

After copying the directory tree (which contains the desired props file) from the MSBuild directory to the one shown above and restarting from scratch, I am now getting:

C:\Program Files\dotnet\sdk\1.0.0-preview3-004056\Extensions\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(25,5): error MSB4184: The expression "Registry:HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\EDev@StanDir" cannot be evaluated. [C:\Users\admin\Documents\Visual Studio 2017\Projects\JsServices\a2spa\A2spa.xproj]

Any tips appreciated.

@SteveSandersonMS
Copy link
Member

Thanks for letting us know.

For now, please use VS2015. Ensuring VS2017RC compatibility is being tracked in issue #440.

@Zwyssigly
Copy link

Zwyssigly commented Dec 13, 2016

I have found a workaround.

This is what I did:

  1. run "dotnet migrate" in the cmd

  2. edit the "YourProjectName.csproj" to this:

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.0</TargetFramework>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <AssemblyName>YourProjectName</AssemblyName>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="**\*.cs" Exclude="node_modules\**\*;bin\**;obj\**;**\*.xproj;packages\**" />
	<None Include="**\*.ts" Exclude="node_modules\**\*;bin\**;obj\**;**\*.xproj;packages\**" />
    <EmbeddedResource Include="**\*.resx" />
    <EmbeddedResource Include="compiler\resources\**\*" />
    <Content Include="appsettings.json;ClientApp\dist\**\*;Views\**\*;web.config;wwwroot\**\*" Exclude="wwwroot\dist\*.map">
      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.AngularServices">
      <Version>1.1.0-beta-000002</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AspNetCore.NodeServices">
      <Version>1.1.0-beta-000002</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AspNetCore.SpaServices">
      <Version>1.1.0-beta-000002</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.NETCore.App">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.NET.Sdk.Web">
      <Version>1.0.0-alpha-20161104-2-112</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AspNetCore.Mvc">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Configuration.CommandLine">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AspNetCore.Routing">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Configuration.Json">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Logging">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Logging.Console">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Logging.Debug">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions">
      <Version>1.1.0</Version>
    </PackageReference>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools">
      <Version>1.0.0-msbuild1-final</Version>
    </DotNetCliToolReference>
  </ItemGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
  </PropertyGroup>
  <Target Name="PrepublishScript" BeforeTargets="PrepareForPublish" Condition=" '$(IsCrossTargetingBuild)' != 'true' ">
    <Exec Command="npm install" />
    <Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
    <Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />
  </Target>
  <Target Name="PostpublishScript" AfterTargets="Publish" Condition=" '$(IsCrossTargetingBuild)' != 'true' " />
</Project>

After that I was able to open to project and run it inside VS 2017.

@stevenshort
Copy link

@hubert-associates did you ever get around this? I'm hitting the same thing.

@ghost
Copy link
Author

ghost commented Feb 1, 2017

Hi, yes, but in the end only by finding a machine where the desired directory existed and copying it onto the machine where it was missing. Works fine since then. Since I wasted lots of time trying to find a clean way to resolve this, I am fairly sure that it is not a feature :-) It only happened on my machines with both VS2017 RC1 and VS2015 installed... Luckily, I still had a machine without the combination...

@arina-fedorova
Copy link

@hubert-associates how did you manage with error
MSB4184: The expression "Registry:HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\EDev@StanDir" cannot be evaluated.

@ghost
Copy link
Author

ghost commented Mar 15, 2017

At that time, I had to copy over the missing files/dirs from another machine where they were installed. Apparently the VS 2017 RC removed them -- they exist on VS 2015 installations. However, this has all been fixed in both the JavascriptServices and VS 2017. So, I'd suggest you just updated both and move forward.

@ChintanRaval
Copy link

I've got this error with only VS2015 installed on my box. I checked the directories, and yes, the tree is missing. Damn.

@ghost
Copy link
Author

ghost commented Apr 5, 2017

I tried to find which install the tree is in, couldn't, so I resorted to finding a PC where it was, and just copying it over ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants