dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.17k stars 1.34k forks source link

MSBuild System.TypeInitializationException #2770

Open SAYAH-IMAD opened 6 years ago

SAYAH-IMAD commented 6 years ago

I created a UWP Fall Creator Update project with a task that is triggered during the build of the project.

i have an error message saying:

(System.TypeInitializationException) An exception was thrown by the type initializer for 'Microsoft.Build.Internal.AvailableStaticMethods'

SAYAH-IMAD commented 6 years ago

FY that happend when i update my vs2017 to 15.4.4 , knowing that it works well before . thank's

itrice commented 4 years ago

I have a similar problem. command: msbuild.exe /version

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.Build.CommandLine.MSBuildApp' threw an exception. ---> System.FieldAccessException: Attempt by method 'Microsoft.Build.CommandLine.MSBuildApp..cctor()' to access field 'Microsoft.Build.Shared.MSBuildConstants.EqualsChar' failed.
   at Microsoft.Build.CommandLine.MSBuildApp..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Build.CommandLine.MSBuildApp.Main()

And I cann't use VS2019. Even the app based on .net framework.