Skip to content

dotnet watch support for Traversal projects (and solutions?)Β #51879

@baronfel

Description

@baronfel

Is your feature request related to a problem? Please describe.

dotnet watch should support operations that are allowed at a solution/traversal level.

Describe the solution you'd like

dotnet watch build --project mysln.sln results in MSbuild errors while calling the GenerateWatchList target - it should be possible for watch to work for any command that itself accepts a solution (or other container-ish thing), like

  • test
  • build
  • publish
  • etc

The error I see for my simple solution running under dotnet watch build is

dotnet watch ❌ Error(s) finding watch items project file 'sdk-container-demo.sln'.
dotnet watch πŸ”¨ MSBuild output from target 'GenerateWatchList':
dotnet watch πŸ”¨ Restore complete (4.2s)
dotnet watch πŸ”¨   msbuild-versioning-sample net8.0 failed with 1 error(s) (0.0s)
dotnet watch πŸ”¨     C:\Program Files\dotnet\sdk\10.0.100\DotnetTools\dotnet-watch\10.0.100\tools\net10.0\any\DotNetWatch.targets(15,5): error MSB4018:
dotnet watch πŸ”¨       The "FileSetSerializer" task failed unexpectedly.
dotnet watch πŸ”¨       System.IO.IOException: The process cannot access the file 'C:\Users\chusk\AppData\Local\Temp\tmpsdm0fx.tmp' becaus
dotnet watch πŸ”¨       e it is being used by another process.
dotnet watch πŸ”¨          at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, Fil
dotnet watch πŸ”¨       eShare share, FileOptions options)
dotnet watch πŸ”¨          at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare
dotnet watch πŸ”¨        share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
dotnet watch πŸ”¨          at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare sha
dotnet watch πŸ”¨       re, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
dotnet watch πŸ”¨          at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, Fil
dotnet watch πŸ”¨       eShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
dotnet watch πŸ”¨          at System.IO.File.Create(String path)
dotnet watch πŸ”¨          at DotNetWatchTasks.FileSetSerializer.Execute()
dotnet watch πŸ”¨          at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
dotnet watch πŸ”¨          at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLogging
dotnet watch πŸ”¨       Context taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
dotnet watch πŸ”¨   multi-arch-sample net8.0 failed with 1 error(s) (0.0s)
dotnet watch πŸ”¨     C:\Program Files\dotnet\sdk\10.0.100\DotnetTools\dotnet-watch\10.0.100\tools\net10.0\any\DotNetWatch.targets(15,5): error MSB4018:
dotnet watch πŸ”¨       The "FileSetSerializer" task failed unexpectedly.
dotnet watch πŸ”¨       System.IO.IOException: The process cannot access the file 'C:\Users\chusk\AppData\Local\Temp\tmpsdm0fx.tmp' becaus
dotnet watch πŸ”¨       e it is being used by another process.
dotnet watch πŸ”¨          at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, Fil
dotnet watch πŸ”¨       eShare share, FileOptions options)
dotnet watch πŸ”¨          at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare
dotnet watch πŸ”¨        share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
dotnet watch πŸ”¨          at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare sha
dotnet watch πŸ”¨       re, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
dotnet watch πŸ”¨          at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, Fil
dotnet watch πŸ”¨       eShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
dotnet watch πŸ”¨          at System.IO.File.Create(String path)
dotnet watch πŸ”¨          at DotNetWatchTasks.FileSetSerializer.Execute()
dotnet watch πŸ”¨          at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
dotnet watch πŸ”¨          at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLogging
dotnet watch πŸ”¨       Context taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
dotnet watch πŸ”¨   aot-sample net8.0 failed with 1 error(s) (0.0s)
dotnet watch πŸ”¨     C:\Program Files\dotnet\sdk\10.0.100\DotnetTools\dotnet-watch\10.0.100\tools\net10.0\any\DotNetWatch.targets(15,5): error MSB4018:
dotnet watch πŸ”¨       The "FileSetSerializer" task failed unexpectedly.
dotnet watch πŸ”¨       System.IO.IOException: The process cannot access the file 'C:\Users\chusk\AppData\Local\Temp\tmpsdm0fx.tmp' becaus
dotnet watch πŸ”¨       e it is being used by another process.
dotnet watch πŸ”¨          at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, Fil
dotnet watch πŸ”¨       eShare share, FileOptions options)
dotnet watch πŸ”¨          at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare
dotnet watch πŸ”¨        share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
dotnet watch πŸ”¨          at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare sha
dotnet watch πŸ”¨       re, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
dotnet watch πŸ”¨          at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, Fil
dotnet watch πŸ”¨       eShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
dotnet watch πŸ”¨          at System.IO.File.Create(String path)
dotnet watch πŸ”¨          at DotNetWatchTasks.FileSetSerializer.Execute()
dotnet watch πŸ”¨          at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
dotnet watch πŸ”¨          at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLogging
dotnet watch πŸ”¨       Context taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
dotnet watch πŸ”¨
dotnet watch πŸ”¨ Build failed with 3 error(s) in 4.6s
dotnet watch πŸ”¨
dotnet watch ⌚ Fix the error to continue or press Ctrl+C to exit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CLIArea-TraversalSdkitems related to the Traversal SDK and its inclusion in the dotnet/sdk repoArea-WatchuntriagedRequest triage from a team member

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions