Microsoft.VisualStudio..Default.props" was not fou

2019-02-26 22:41发布

I've been searching around but what I got is something like

The imported project "C:...\Microsoft.Cpp.Default.props" was not found,
instead of 
"C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Microsoft.VisualStudio..Default.props" was not found.". See the diff, the former is "Microsoft.Cpp.Default.props" while my error is Microsoft.VisualStudio..Default.props. Here's the full error log:

Path To MSBuild.exe: C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild
Executing the command cmd.exe /C " "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild" /t:Build,Publish /p:Configuration=Release /p:platform=x86 "platforms\windows\CordovaApp.Windows.jsproj" " && exit %%ERRORLEVEL%% from E:\Jenkins\workspace\Mobile Field Service (Windows)
[Mobile Field Service (Windows)] $ cmd.exe /C " "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild" /t:Build,Publish /p:Configuration=Release /p:platform=x86 "platforms\windows\CordovaApp.Windows.jsproj" " && exit %%ERRORLEVEL%%
Microsoft (R) Build Engine version 12.0.30501.0
[Microsoft .NET Framework, version 4.0.30319.34014]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 11/26/2015 4:27:09 AM.
Project "E:\Jenkins\workspace\Mobile Field Service (Windows)\platforms\windows\CordovaApp.Windows.jsproj" on node 1 (Build;Publish target(s)).
E:\Jenkins\workspace\Mobile Field Service (Windows)\platforms\windows\CordovaApp.Windows.jsproj(52,5): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Microsoft.VisualStudio..Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "E:\Jenkins\workspace\Mobile Field Service (Windows)\platforms\windows\CordovaApp.Windows.jsproj" (Build;Publish target(s)) -- FAILED.

Build FAILED.

"E:\Jenkins\workspace\Mobile Field Service (Windows)\platforms\windows\CordovaApp.Windows.jsproj" (Build;Publish target) (1) ->
  E:\Jenkins\workspace\Mobile Field Service (Windows)\platforms\windows\CordovaApp.Windows.jsproj(52,5): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Microsoft.VisualStudio..Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.79
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
Archiving artifacts
Finished: FAILURE

By the way is it ok that my OS is Windows 2012 R2?

标签: npm
2条回答
地球回转人心会变
2楼-- · 2019-02-26 23:19

I got the MSB4019 error because I did not have write permissions on C.

Executing the command with admin privileges helped in my case, but changing read/write permissions on C for your Windows user account should also work.

Other options are listed in this thread.

查看更多
Evening l夕情丶
3楼-- · 2019-02-26 23:33

Check whether Microsoft.TypeScript.Default.props is available in the following location of your jenkins server

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript

And if not try to copy it from your local machine (if it is available in your local machine and your jenkins in a separate server) and create the required folder structure

OR

Add this conditional import statement in the project file

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props"
             Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
查看更多
登录 后发表回答