I've been encountering IOExceptions pretty often while trying out the scaffold, and I think I've narrowed it down to the changes introduced in #129: there are two dotnet watch processes running, and when I change a file in the server code, they both try to generate the src/Server/bin/Debug/netcoreapp1.1/Server.runtimeconfig.json
file at the same time, resulting in one of them throwing an IOException and shutting down.
The watch processes should not interfere with each other, or there should be just a single watch process.
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: The "GenerateRuntimeConfigurationFiles" task failed unexpectedly. [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: System.IO.IOException: The process cannot access the file '/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/bin/Debug/netcoreapp1.1/Server.runtimeconfig.json' because it is being used by another process. [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.UnixFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.UnixFileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteToJsonFile(String fileName, Object value) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteRuntimeConfig(ProjectContext projectContext) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.ExecuteCore() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
/home/rmunn/.local/share/dotnetcore/sdk/1.0.4/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(129,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
The build failed. Please fix the build errors and run again.
watch : Exited with error code 1
error MSB4018: The "GenerateRuntimeConfigurationFiles" task failed unexpectedly. [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: System.IO.IOException: The process cannot access the file '/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/bin/Debug/netcoreapp1.1/Server.runtimeconfig.json' because it is being used by another process. [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at System.IO.UnixFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at System.IO.UnixFileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteToJsonFile(String fileName, Object value) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.WriteRuntimeConfig(ProjectContext projectContext) [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.ExecuteCore() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() [/home/rmunn/code/fsharp/fable/test-scaffold/src/Server/Server.fsproj]
The build failed. Please fix the build errors and run again.
watch : Exited with error code 1