question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"MSB4036: The "RazorGenerate" task was not found" when building Blazor client project

See original GitHub issue

Problem

Unable to build a Blazor project based on the ASP.NET Core template: “Blazor (ASP.Net Core hosted)

Error message

error MSB4036: The “RazorGenerate” task was not found. Check the following:

  1. The name of the task in the project file is the same as the name of the task class.
  2. The task class is “public” and implements the Microsoft.Build.Framework.ITask interface.
  3. The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the “C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin” directory.

Complete build output

1>------ Rebuild All started: Project: BlazorTest.Shared, Configuration: Debug Any CPU ------
1>C:\Program Files\dotnet\sdk\3.0.100-preview3-010431\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(151,5): message NETSDK1057: You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
1>BlazorTest.Shared -> C:\Code\BlazorTest.Shared\bin\Debug\netstandard2.0\BlazorTest.Shared.dll
2>------ Rebuild All started: Project: BlazorTest.Client, Configuration: Debug Any CPU ------
2>C:\Program Files\dotnet\sdk\3.0.100-preview3-010431\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.Component.targets(93,5): error MSB4036: The "RazorGenerate" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin" directory.
2>Done building project "BlazorTest.Client.csproj" -- FAILED.
3>------ Rebuild All started: Project: BlazorTest.Server, Configuration: Debug Any CPU ------
3>CSC : error CS0006: Metadata file 'C:\Code\BlazorTest.Client\bin\Debug\netstandard2.0\BlazorTest.Client.dll' could not be found
3>Done building project "BlazorTest.Server.csproj" -- FAILED.
========== Rebuild All: 1 succeeded, 2 failed, 0 skipped ==========

Client project file

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <OutputType>Exe</OutputType>
    <RestoreAdditionalProjectSources>
      https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
      https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
    </RestoreAdditionalProjectSources>
    <LangVersion>7.3</LangVersion>
    <RazorLangVersion>3.0</RazorLangVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview4-19216-03" />
    <PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview4-19216-03" PrivateAssets="all" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\BlazorTest.Shared\BlazorTest.Shared.csproj" />
  </ItemGroup>
</Project>

Comparing the project file with an older Blazor project which builds

In my older working Blazor project I can see references to these NuGet packages, in additions to the two Blazor packages.

Microsoft.AspNetCore.Components" Version="3.0.0-preview3-19153-02"
Microsoft.NETCore.Platforms" Version="3.0.0-preview3.19128.7"

Output from: Install-Package -Verbose

PM> $pkgs = Get-Package -ProjectName BlazorTest.Client
PM> $pkgs | %{"`n`n= = = = = START - Package: $_ = = = = = = "; Install-Package -Id $($_.Id) -Version $($_.Versions)    -ProjectName BlazorTest.Client -Verbose; "= = = = = STOP - Package: $_ = = = = = = `n`n";}

= = = = = START - Package: NuGet.PackageManagement.PowerShellCmdlets.PowerShellInstalledPackage = = = = = = 
Running restore with 4 concurrent jobs.
Reading project file C:\Code\BlazorTest.Client\BlazorTest.Client.csproj.
Persisting no-op dg to C:\Code\BlazorTest.Client\obj\BlazorTest.Client.csproj.nuget.dgspec.json
Restoring packages for C:\Code\BlazorTest.Client\BlazorTest.Client.csproj...
Restoring packages for .NETStandard,Version=v2.0...
Resolving conflicts for .NETStandard,Version=v2.0...
Checking compatibility of packages on .NETStandard,Version=v2.0.
Checking compatibility for BlazorTest.Client 1.0.0 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Blazor.Build 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Blazor 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for NETStandard.Library 2.0.3 with .NETStandard,Version=v2.0.
Checking compatibility for BlazorTest.Shared 1.0.0 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Blazor.Mono 0.10.0-preview-20190325.1 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Components.Browser 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for Mono.WebAssembly.Interop 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.NETCore.Platforms 1.1.0 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Components 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.Extensions.DependencyInjection 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.JSInterop 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
Checking compatibility for System.ComponentModel.Annotations 4.6.0-preview4.19212.13 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.Extensions.DependencyInjection.Abstractions 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
All packages and projects are compatible with .NETStandard,Version=v2.0.
Installing NuGet package Microsoft.AspNetCore.Blazor.Build 3.0.0-preview4-19216-03.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\Code\BlazorTest.Client\obj\project.assets.json
Writing cache file to disk. Path: C:\Code\BlazorTest.Client\obj\BlazorTest.Client.csproj.nuget.cache
Restore completed in 45.06 ms for C:\Code\BlazorTest.Client\BlazorTest.Client.csproj.
Running restore with 4 concurrent jobs.
Reading project file C:\Code\BlazorTest.Server\BlazorTest.Server.csproj.
The restore inputs for 'BlazorTest.Server' have not changed. No further actions are required to complete the restore.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\Code\BlazorTest.Server\obj\project.assets.json
No-Op restore. The cache will not be updated. Path: C:\Code\BlazorTest.Server\obj\BlazorTest.Server.csproj.nuget.cache
Restore completed in 15.64 ms for C:\Code\BlazorTest.Server\BlazorTest.Server.csproj.

NuGet Config files used:
    C:\Users\xxxxx\AppData\Roaming\NuGet\NuGet.Config
    C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
    C:\Program Files (x86)\NuGet\Config\Xamarin.Offline.config

Feeds used:
    https://api.nuget.org/v3/index.json
    C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
    https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json
    https://dotnet.myget.org/F/blazor-dev/api/v3/index.json
Executing nuget actions took 76.96 ms
Time Elapsed: 00:00:01.4167282
= = = = = STOP - Package: NuGet.PackageManagement.PowerShellCmdlets.PowerShellInstalledPackage = = = = = = 

= = = = = START - Package: NuGet.PackageManagement.PowerShellCmdlets.PowerShellInstalledPackage = = = = = = 
Running restore with 4 concurrent jobs.
Reading project file C:\Code\BlazorTest.Client\BlazorTest.Client.csproj.
Persisting no-op dg to C:\Code\BlazorTest.Client\obj\BlazorTest.Client.csproj.nuget.dgspec.json
Restoring packages for C:\Code\BlazorTest.Client\BlazorTest.Client.csproj...
Restoring packages for .NETStandard,Version=v2.0...
Resolving conflicts for .NETStandard,Version=v2.0...
Checking compatibility of packages on .NETStandard,Version=v2.0.
Checking compatibility for BlazorTest.Client 1.0.0 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Blazor.Build 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Blazor 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for NETStandard.Library 2.0.3 with .NETStandard,Version=v2.0.
Checking compatibility for BlazorTest.Shared 1.0.0 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Blazor.Mono 0.10.0-preview-20190325.1 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Components.Browser 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for Mono.WebAssembly.Interop 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.NETCore.Platforms 1.1.0 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Components 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.Extensions.DependencyInjection 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.JSInterop 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
Checking compatibility for System.ComponentModel.Annotations 4.6.0-preview4.19212.13 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.Extensions.DependencyInjection.Abstractions 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
All packages and projects are compatible with .NETStandard,Version=v2.0.
Installing NuGet package Microsoft.AspNetCore.Blazor 3.0.0-preview4-19216-03.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\Code\BlazorTest.Client\obj\project.assets.json
Writing cache file to disk. Path: C:\Code\BlazorTest.Client\obj\BlazorTest.Client.csproj.nuget.cache
Restore completed in 85.94 ms for C:\Code\BlazorTest.Client\BlazorTest.Client.csproj.
Running restore with 4 concurrent jobs.
Reading project file C:\Code\BlazorTest.Server\BlazorTest.Server.csproj.
The restore inputs for 'BlazorTest.Server' have not changed. No further actions are required to complete the restore.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\Code\BlazorTest.Server\obj\project.assets.json
No-Op restore. The cache will not be updated. Path: C:\Code\BlazorTest.Server\obj\BlazorTest.Server.csproj.nuget.cache
Restore completed in 12.18 ms for C:\Code\BlazorTest.Server\BlazorTest.Server.csproj.

NuGet Config files used:
    C:\Users\xxxxx\AppData\Roaming\NuGet\NuGet.Config
    C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
    C:\Program Files (x86)\NuGet\Config\Xamarin.Offline.config

Feeds used:
    https://api.nuget.org/v3/index.json
    C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
    https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json
    https://dotnet.myget.org/F/blazor-dev/api/v3/index.json
Executing nuget actions took 71.66 ms
Time Elapsed: 00:00:01.4810819
= = = = = STOP - Package: NuGet.PackageManagement.PowerShellCmdlets.PowerShellInstalledPackage = = = = = = 

= = = = = START - Package: NuGet.PackageManagement.PowerShellCmdlets.PowerShellInstalledPackage = = = = = = 
Running restore with 4 concurrent jobs.
Reading project file C:\Code\BlazorTest.Client\BlazorTest.Client.csproj.
Persisting no-op dg to C:\Code\BlazorTest.Client\obj\BlazorTest.Client.csproj.nuget.dgspec.json
Restoring packages for C:\Code\BlazorTest.Client\BlazorTest.Client.csproj...
Restoring packages for .NETStandard,Version=v2.0...
Resolving conflicts for .NETStandard,Version=v2.0...
Checking compatibility of packages on .NETStandard,Version=v2.0.
Checking compatibility for BlazorTest.Client 1.0.0 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Blazor.Build 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Blazor 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for NETStandard.Library 2.0.3 with .NETStandard,Version=v2.0.
Checking compatibility for BlazorTest.Shared 1.0.0 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Blazor.Mono 0.10.0-preview-20190325.1 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Components.Browser 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for Mono.WebAssembly.Interop 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.NETCore.Platforms 1.1.0 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.AspNetCore.Components 3.0.0-preview4-19216-03 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.Extensions.DependencyInjection 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.JSInterop 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
Checking compatibility for System.ComponentModel.Annotations 4.6.0-preview4.19212.13 with .NETStandard,Version=v2.0.
Checking compatibility for Microsoft.Extensions.DependencyInjection.Abstractions 3.0.0-preview4.19216.2 with .NETStandard,Version=v2.0.
All packages and projects are compatible with .NETStandard,Version=v2.0.
Installing NuGet package NETStandard.Library 2.0.3.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\Code\BlazorTest.Client\obj\project.assets.json
Writing cache file to disk. Path: C:\Code\BlazorTest.Client\obj\BlazorTest.Client.csproj.nuget.cache
Restore completed in 60.6 ms for C:\Code\BlazorTest.Client\BlazorTest.Client.csproj.
Running restore with 4 concurrent jobs.
Reading project file C:\Code\BlazorTest.Server\BlazorTest.Server.csproj.
The restore inputs for 'BlazorTest.Server' have not changed. No further actions are required to complete the restore.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\Code\BlazorTest.Server\obj\project.assets.json
No-Op restore. The cache will not be updated. Path: C:\Code\BlazorTest.Server\obj\BlazorTest.Server.csproj.nuget.cache
Restore completed in 12.31 ms for C:\Code\BlazorTest.Server\BlazorTest.Server.csproj.

NuGet Config files used:
    C:\Users\xxxxx\AppData\Roaming\NuGet\NuGet.Config
    C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
    C:\Program Files (x86)\NuGet\Config\Xamarin.Offline.config

Feeds used:
    https://api.nuget.org/v3/index.json
    C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
    https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json
    https://dotnet.myget.org/F/blazor-dev/api/v3/index.json
Executing nuget actions took 79.81 ms
Time Elapsed: 00:00:01.5362542
= = = = = STOP - Package: NuGet.PackageManagement.PowerShellCmdlets.PowerShellInstalledPackage = = = = = = 

Visual Studio & Tooling version info

Microsoft Visual Studio Professional 2019 Preview
Version 16.1.0 Preview 2.0
VisualStudio.16.Preview/16.1.0-pre.2.0+28822.285
Microsoft .NET Framework
Version 4.7.03056

Installed Version: Professional

Visual C++ 2019   00435-60000-00000-AA166
Microsoft Visual C++ 2019

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

Application Insights Tools for Visual Studio Package   9.0.20307.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019   16.1.302.53887
ASP.NET and Web Tools 2019

ASP.NET Core Blazor Language Services   16.0.19216.03

ASP.NET Web Frameworks and Tools 2019   16.1.302.53887
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.1.302.53887
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.3.8000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools   16.1.302.53887
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio   2.3.8000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools   3.1.0-beta2-19211-01+9d88fee4efb9f7ae4ae053d63b9f8b5b31217c90
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter   16.1.19098.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Dotfuscator Community Edition   5.40.1.8956-03f69f61d
PreEmptive Protection - Dotfuscator CE

Extensibility Message Bus   1.1.77 (master@24013d5)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

ILSpy.AddIn   1.0
Integration of the ILSpy Decompiler into Visual Studio.

LineEndingsUnifierPackage Extension   1.0
LineEndingsUnifierPackage Visual Studio Extension Detailed Info

Microsoft Azure HDInsight Azure Node   2.3.8000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.3.8000.0
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio   2.5
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service   2.3.8000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.0.0

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   1.0
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   16.1.1 (2473f22)
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.5.10326.1 Commit Hash:f12bb7408a1f644400cbb5ca43f601559ea6bec5
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager   5.1.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio   16.0.28803.01
Microsoft Office Developer Tools for Visual Studio

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Python   16.1.19098.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Python - Conda support   16.1.19098.1
Conda support for Python projects.

Python - Django support   16.1.19098.1
Provides templates and integration for the Django web framework.

Python - IronPython support   16.1.19098.1
Provides templates and integration for IronPython-based projects.

Python - Profiling support   16.1.19098.1
Profiling support for Python projects.

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.61904.17120
Microsoft SQL Server Data Tools

Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   16.0.10411.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.1.0-beta2-19211-01+9d88fee4efb9f7ae4ae053d63b9f8b5b31217c90
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6   16.0.0.0.  Commit Hash: 809f41207b74a1356208f11b8fa3a15233734050.
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes   1.0
Visual Studio Tools for Kubernetes

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   16.1.0.528 (d16-1@3cff8c337)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.1.0.354 (remotes/origin/d16-1@9b140252a)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.1.401 (72b3e35)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   9.3.0.14 (HEAD/f3f2aeb7a)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: mono/mono/2018-08@bf4e8d2ae19
    Java.Interop: xamarin/java.interop/d16-1@5ddc3e3
    LibZipSharp: grendello/LibZipSharp/master@44de300
    LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.27.1@8212a2d
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-1@acabd26


Xamarin.iOS and Xamarin.Mac SDK   12.10.0.147 (a5f2633)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Bartolomeus-649commented, May 2, 2019

This is not good!! I spend a huge amount of time on this and it turns out that I need an update!

  1. Nowhere in Visual studio there is any indication that anything needs updating.
  2. Visual Studio show no indications of anything needing updating.
  3. No NuGet packages indicate any need of anything needs to be updated
  4. The manage Extension tool in Visual Studio does not indicate any need of anything needing updating.
  5. Windows Update does indicate that anything needs to be updated.
  6. The build process does not indicate that there is any mismatching between versions and that something needs to be updated.

Something gladly updated the templates for creating a new Blazor project but did not at the same time update dependants that are REQUIRED for that update to work!

Something is obviously wrong here, this state should never be allowed to happen under normal circumstances, and if it still happen there should be constraints in several places that make sure it is obvious what is the problem and what’s needed to be done to make it working.

  1. A nuget package that depend on specific build-tasks should check that those are available.
  2. A template that depends on external components, whatever they might be, should check and make sure they exist and are of the correct version/build/platform and so on.
  3. Under no circumstances should there be any way that a missing update does not show up clearly inside Visual Studio.

And, isn’t the preview SDK like a complete new version the entire .NET runtime? This seems to be like a project targeting .NET 2 and the machine only has .NET 1 and you get an error message that a build task is missing?


Don’t build systems that work, build systems that can’t fail! On 2011-03-10, the guys at Fukushima thought they had a system that works, but the very next day they found out is sure could fail and overheat, while being built on the shore to the Pacific Ocean…

1reaction
pranavkmcommented, Apr 29, 2019

Do you have the preview4 SDK installed: https://dotnet.microsoft.com/download/dotnet-core/3.0? The error message here: C:\Program Files\dotnet\sdk\3.0.100-preview3-010431\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.Component.targets 93 makes me think you have a mismatched runtime and SDK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "RazorGenerate" task was not found. Trying to run a ...
The "RazorGenerate" task was not found. Trying to run a Blazor project in a Rider IDE and always get this error. What's wrong?...
Read more >
The "RazorGenerate" task was not found. Trying to run a ...
Coding example for the question The "RazorGenerate" task was not found. Trying to run a Blazor project in a Rider IDE and always...
Read more >
Error MSB4018: The "RazorGenerate" task failed ...
CodeGeneration.targets(5,5): Error MSB4018: The "RazorGenerate" task failed unexpectedly. System.InvalidOperationException: DOTNET_HOST_PATH is not set
Read more >
After Update VS2019 16.8.1 I receive and build error ...
Unexpected Error on RazorGenerate Task System.InvalidOperationException: DOTNET_HOST_PATH is not set bei Microsoft.AspNetCore.Razor.Tasks.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found