I want to use SlnGenSolutionFileFullPath to put all my generated solution files in one place. To achieve this I have this property in my global properties:
<PropertyGroup>
<SlnGenSolutionFileFullPath>$(MSBuildThisFileDirectory).sln\$(MSBuildProjectName).sln</SlnGenSolutionFileFullPath>
<SlnGenFolders>true</SlnGenFolders>
</PropertyGroup>
F:\Fx\Main [master ≡ +1 ~1 -0 !]
λ slngen .\Product\Tests\Framework\
Microsoft (R) Build Engine version 15.7.180.61344 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Loading project references...
Generating Visual Studio solution "F:\Fx\Main\.sln\dirs.sln" ...
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: The "SlnGen" task failed unexpectedly. [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path 'F:\Fx\Main\.sln\dirs.sln'. [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromPr oxy, Boolean useLongPath, Boolean checkHost) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) [F:\Fx\Main\Produ ct\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.StreamWriter..ctor(String path, Boolean append) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.File.CreateText(String path) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at SlnGen.Build.Tasks.Internal.SlnFile.Save(String path, Boolean folders) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at SlnGen.Build.Tasks.SlnGen.GenerateSolutionFile(ICollection`1 projects) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at SlnGen.Build.Tasks.SlnGen.ExecuteTask() [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at SlnGen.Build.Tasks.TaskBase.Execute() [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
Build FAILED.
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: The "SlnGen" task failed unexpectedly. [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path 'F:\Fx\Main\.sln\dirs.sln'. [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromPr oxy, Boolean useLongPath, Boolean checkHost) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) [F:\Fx\Main\Produ ct\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.StreamWriter..ctor(String path, Boolean append) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at System.IO.File.CreateText(String path) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at SlnGen.Build.Tasks.Internal.SlnFile.Save(String path, Boolean folders) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at SlnGen.Build.Tasks.SlnGen.GenerateSolutionFile(ICollection`1 projects) [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at SlnGen.Build.Tasks.SlnGen.ExecuteTask() [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at SlnGen.Build.Tasks.TaskBase.Execute() [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
C:\Users\pachun\.nuget\packages\slngen\2.1.3\build\SlnGen.targets(25,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [F:\Fx\Main\Product\Tests\Framework\dirs.proj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:05.05 ```
When I create the .sln folder, it works. It should create folders that don't exist in the path.