Skip to content

dotnet watch run broken on .NET 6 preview 5 #11793

Closed
@2mol

Description

@2mol

Repro steps

  1. mkdir bla && cd bla
  2. dotnet new console -lang F#
  3. dotnet run (just to confirm that it works)
  4. dotnet watch run

Expected behavior

The code compiles, runs, and the dotnet utility switches into "watch mode".

Actual behavior

The code compiles, runs, shows the "Hello world from F#" output, and then crashes with

watch : Waiting for a file to change before restarting dotnet...
Unhandled exception. System.InvalidOperationException: Cannot open project '/Users/user/bla/bla.fsproj' because the file extension '.fsproj' is not associated with a language.
   at Microsoft.CodeAnalysis.MSBuild.DiagnosticReporter.Report(DiagnosticReportingMode mode, String message, Func`2 createException) in Microsoft.CodeAnalysis.Workspaces.MSBuild.dll:token 0x600003d+0x25
   at Microsoft.CodeAnalysis.MSBuild.ProjectFileLoaderRegistry.TryGetLoaderFromProjectPath(String projectFilePath, DiagnosticReportingMode mode, IProjectFileLoader& loader) in Microsoft.CodeAnalysis.Workspaces.MSBuild.dll:token 0x6000103+0xd7
   at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.LoadProjectFileInfosAsync(String projectPath, DiagnosticReportingOptions reportingOptions, CancellationToken cancellationToken) in Microsoft.CodeAnalysis.Workspaces.MSBuild.dll:token 0x6000157+0x59
   at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.LoadProjectInfosFromPathAsync(String projectPath, DiagnosticReportingOptions reportingOptions, CancellationToken cancellationToken) in Microsoft.CodeAnalysis.Workspaces.MSBuild.dll:token 0x6000158+0xca
   at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.LoadAsync(CancellationToken cancellationToken) in Microsoft.CodeAnalysis.Workspaces.MSBuild.dll:token 0x6000156+0x13a
   at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.LoadProjectInfoAsync(String projectFilePath, ProjectMap projectMap, IProgress`1 progress, ILogger msbuildLogger, CancellationToken cancellationToken) in Microsoft.CodeAnalysis.Workspaces.MSBuild.dll:token 0x6000054+0x100
   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.OpenProjectAsync(String projectFilePath, ILogger msbuildLogger, IProgress`1 progress, CancellationToken cancellationToken) in Microsoft.CodeAnalysis.Workspaces.MSBuild.dll:token 0x6000067+0xb2
   at Microsoft.DotNet.Watcher.Tools.CompilationWorkspaceProvider.CreateProject(TaskCompletionSource`1 taskCompletionSource, String projectPath, IReporter reporter, CancellationToken cancellationToken) in dotnet-watch.dll:token 0x600017b+0xed
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_1(Object state) in System.Private.CoreLib.dll:token 0x6002d46+0x0
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute() in System.Private.CoreLib.dll:token 0x6002a89+0x14
   at System.Threading.ThreadPoolWorkQueue.Dispatch() in System.Private.CoreLib.dll:token 0x6002a63+0xb2
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in System.Private.CoreLib.dll:token 0x6002b3e+0x57
   at System.Threading.Thread.StartCallback() in System.Private.CoreLib.dll:token 0x60026de+0xe

Known workarounds

none

Related information

  • Operating system: macOS Big Sur, on an M1 processor
  • .NET Runtime: .NET 6 (preview)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions