Microsoft.WebApplication.targets

Harvey Colasino 6 Reputation points
2022-03-21T18:22:32.457+00:00

After I setup my workflow in GitHub for building and deploying my project to Azure, I'm getting this error:

"C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\5.0.406\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\5.0.406\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" is correct, and that the file exists on disk.

I tried the following suggestion from the article:

https://alastaircrabtree.com/microsoft-webapplication-targets-was-not-found-again/

Can anyone help?

Thank you

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
40,301 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Jamie Masculine 15 Reputation points
    2023-08-25T19:01:15.6933333+00:00

    I want to preface this by saying, this solution does not feel right, but does seem to work.

    I found this article from Microsoft and installed web tools

    dotnet workload install wasm-tools-net6
    

    Then I went to the location called out by the error and copied the WebApplications folder from v16.0 to v17.0

    cd /lib/mono/xbuild/Microsoft/VisualStudio/
    sudo cp -r v16.0/WebApplications v17.0
    

    There should be a more official way to handle this, but this at least got me to a point where I could build projects at work again

    1 person found this answer helpful.
    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Ilya 0 Reputation points
    2024-02-09T16:56:56.6766667+00:00

    Same issue. net48 solution need to be built be "dotnet msbuild" as Teamcity no longer support VS .sln builds.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.