Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2mol opened this issue Jul 7, 2021 · 5 comments
Closed

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

2mol opened this issue Jul 7, 2021 · 5 comments
Labels
Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.

Comments

@2mol
Copy link

2mol commented Jul 7, 2021

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)
@kerams
Copy link
Contributor

kerams commented Jul 7, 2021

@2mol
Copy link
Author

2mol commented Jul 7, 2021

Cool, thanks. However hot reload was my initial reason for trying preview 6, so the --no-hot-reload workaround will only be of limited use in this case.

@kerams
Copy link
Contributor

kerams commented Jul 7, 2021

#11636

Not supported. As simple as that.

@2mol
Copy link
Author

2mol commented Jul 7, 2021

Oh ok, then we'll have to be patient, that's fine by me.

This issue can then be re-interpreted as "It would be better to not throw an exception + an incorrect error message".

@kerams
Copy link
Contributor

kerams commented Jul 7, 2021

I believe you'll have to open an issue in the ASP repo for that.

@KevinRansom KevinRansom added the Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. label Jul 7, 2021
@KevinRansom KevinRansom added Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. and removed Impact-High (Internal MS Team use only) Describes an issue with extreme impact on existing code. labels Jul 7, 2021
@dsyme dsyme closed this as completed Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
None yet
Development

No branches or pull requests

5 participants