Skip to content

After installing VS 17.4, I can't run dotnet watch for .NET6 projects #33592

@Saibamen

Description

@Saibamen

Description

After installing VS 17.4, I can't run dotnet watch for .NET6 projects

Reproduction Steps

  1. Make sure you have .NET 6 SDK and runtime installed
  2. Install Visual Studio 17.4 - it will install .NET 7 (FYI: one of my colleagues lost .NET 6 SDK after installing VS 17.4...)
  3. Run dotnet watch on one of your projects with <TargetFramework>net6.0</TargetFramework> inside csproj

Expected behavior

It will run without any problem

Actual behavior

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Nie można odnaleźć określonego pliku.
File name: 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.Reflection.RuntimeAssembly.GetType(QCallAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive, ObjectHandleOnStack assemblyLoadContext)
at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
at System.StartupHookProvider.CallStartupHook(StartupHookNameOrPath startupHook)
at System.StartupHookProvider.ProcessStartupHooks()
dotnet watch ❌ Exited with error code -532462766

Regression?

Yes

Known Workarounds

global.json:

{
    "sdk": {
        "version": "6.0.302"
     }
}

Configuration

  • .NET 6 project
  • Windows
  • x64

Other information

Installed both .NET 6 and .NET 7 SDK and runtime

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions