I recently upgraded my Visual Studio 2017 ASP.NET Core MVC web project by adding the Microsoft.TypeScript.MSBuild NuGet package v2.3.1 and updating my ASP.NET Core assemblies from 1.0.* to 1.1.1. However, after these changes, I encountered a new exception when building my project:
Severity Code Description Project File Line Suppression State
Error MSB4018 The "CheckFileSystemCaseSensitive" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at TypeScript.Tasks.CheckFileSystemCaseSensitive.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
When I double-click on the exception message, it takes me to specific lines in the file Microsoft.TypeScript.targets where the error indicates that "MSBuildThisFileFullPath is not defined".
<Target Name="CheckFileSystemCaseSensitive">
<CheckFileSystemCaseSensitive
MSBuildThisFileFullPath="$(MSBuildThisFileFullPath)" >
<Output TaskParameter="IsFileSystemCaseSensitive" PropertyName="IsFileSystemCaseSensitive" />
</CheckFileSystemCaseSensitive>
</Target>
I've attempted to resolve this issue by adding references to NETStandard.Library as suggested here, but unfortunately, that has not made any difference.
Here is an excerpt of the diagnostic MSBuild output related to this problem:
1>Target "CheckFileSystemCaseSensitive" in file "C:\Users\dkent\.nuget\packages\microsoft.typescript.msbuild\2.3.1\tools\netstandard1.3\Microsoft.TypeScript.targets":
1> Using "CheckFileSystemCaseSensitive" task from assembly "C:\Users\dkent\.nuget\packages\microsoft.typescript.msbuild\2.3.1\tools\netstandard1.3\TypeScript.Tasks.dll".
1> Task "CheckFileSystemCaseSensitive"
1> Task Parameter:MSBuildThisFileFullPath=C:\Users\dkent\.nuget\packages\microsoft.typescript.msbuild\2.3.1\tools\netstandard1.3\Microsoft.TypeScript.targets
1> [...]\.nuget\packages\microsoft.typescript.msbuild\2.3.1\tools\netstandard1.3\Microsoft.TypeScript.targets(172,5): error MSB4018: The "CheckFileSystemCaseSensitive" task failed unexpectedly.
1> [...]\.nuget\packages\microsoft.typescript.msbuild\2.3.1\tools\netstandard1.3\Microsoft.TypeScript.targets(172,5): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
1> [...]\.nuget\packages\microsoft.typescript.msbuild\2.3.1\tools\netstandard1.3\Microsoft.TypeScript.targets(172,5): error MSB4018: File name: 'System.IO.FileSystem, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
1> [...]\.nuget\packages\microsoft.typescript.msbuild\2.3.1\tools\netstandard1.3\Microsoft.TypeScript.targets(172,5): error MSB4018: at TypeScript.Tasks.CheckFileSystemCaseSensitive.Execute()
1> [...]\.nuget\packages\microsoft.typescript.msbuild\2.3.1\tools\netstandard1.3\Microsoft.TypeScript.targets(172,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1> [...]\.nuget\packages\microsoft.typescript.msbuild\2.3.1\tools\netstandard1.3\Microsoft.TypeScript.targets(172,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1> Done executing task "CheckFileSystemCaseSensitive" -- FAILED.
If anyone has any suggestions on how to resolve this issue, I would greatly appreciate your input. Thank you.