0
votes

I have an asp.net core application that hosts a Outlook Add-in Angular application. This builds and deploys fine on my local machine.

I have created a build in VSTS using the ASP.NET core template, which we have modified with steps to do "npm install" and "npm build".

Everything works up until the .net core restore step. When this step runs I get an error saying

d:\a\3\s\Master\node_modules\openxml-js\OpenXmlSdkJs-01-01-02\OpenXmlSdkJs.csproj(114,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.0.2\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I'm not referencing this package so it must be a dependency of a package I am referencing. When looking at the csproj file that is referenced I can see

<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />

which I believe is causing the errors.

Does anyone have any ideas on how I can fix this?

1
What's the agent did you use, Hosted agent or Hosted VS2017 agent?Marina Liu
@MarinaLiu-MSFT it is using Hosted VS2017David Duncan
I changed to use the Hosted agent but I now get "error: Invalid input 'd:\a\1\s\Master\node_modules\openxml-js\OpenXmlSdkJs-01-01-02\OpenXmlSdkJs.csproj'. The file type was not recognized." FYI. I am using VS2017 to develop this app.David Duncan
If you are develop the project in VS2017, where does <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> refered from? And Can you build the project successful on local machine? Or can you upload the project in one drive.Marina Liu
This is coming from a package that it is trying to install. It is not a package I have included but must be a dependency of one that I have. In the original error message it is pointing to d:\a\3\s\Master\node_modules\openxml-js\OpenXmlSdkJs-01-01-02\OpenXmlSdkJs.csprojDavid Duncan

1 Answers

0
votes

I found the problem.

I opened the package-lock.json file and found what package was using this dependency. I had installed office-js rather than @microsoft/office-js.

Once I installed the correct package, it all built fine.