Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild error MSB4018: The "GenerateResource" task failed unexpectedly

Tags:

msbuild

I try to build a solution with MSBuild command line (on a clean machine) when only Build Tools 2015, .NET developer pack and .NET SDK are installed I get following error:

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2718,5): error MSB4018: The "GenerateResource" task failed unexpectedly.
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2718,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2718,5): error MSB4018:    at Microsoft.Build.Tasks.ResGenDependencies.GetResXFileInfo(String resxFile)
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2718,5): error MSB4018:    at Microsoft.Build.Tasks.GenerateResource.ShouldRebuildResgenOutputFile(String sourceFilePath, String outputFilePath)
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2718,5): error MSB4018:    at Microsoft.Build.Tasks.GenerateResource.GetResourcesToProcess(List`1& inputsToProcess, List`1& outputsToProcess, List`1& cachedOutputFiles)
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2718,5): error MSB4018:    at Microsoft.Build.Tasks.GenerateResource.Execute()
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2718,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2718,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

What's wrong?

like image 787
Toni Wenzel Avatar asked Nov 20 '15 13:11

Toni Wenzel


1 Answers

Delete all build outputs and build again. Suggested from Rainer Sigwald (https://github.com/Microsoft/msbuild/issues/364).

like image 162
Toni Wenzel Avatar answered Oct 13 '22 03:10

Toni Wenzel