[转]error MSB4018: The "GenerateResource" task failed unexpectedly
2017-04-11 11:33
501 查看
本文转自:https://github.com/Microsoft/msbuild/issues/364
After uninstall Visual Studio 2015 Update 1 RC and reinstall VS 2015 RTM I can't compile any of my projects any more. Following error occurs:
[/code]
https://github.com/Microsoft/msbuild/pull/314
This fixes the scenario of switching builds using RTM and Update 1.
Normal usage this should only be for an uninstall scenario since MSBuild is typically in the GAC,
but in cases of a checked in toolset or using the open source version we should be backwards compatible.
This is just renaming the fields back for the cache classes.
https://github.com/Microsoft/msbuild/pull/466
http://stackoverflow.com/questions/31608319/msbuild-error-msb4018-in-vs2015-the-link-task-failed-unexpectedly
https://blogs.msdn.microsoft.com/visualstudio/2013/07/24/msbuild-is-now-part-of-visual-studio/?replytocom=73743
MSBuild and its Toolset now Version with Visual Studio
After uninstall Visual Studio 2015 Update 1 RC and reinstall VS 2015 RTM I can't compile any of my projects any more. Following error occurs:
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2718,5): error MSB4018: The "GenerateResource" task failed unexpectedly. 1>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.
[/code]
https://github.com/Microsoft/msbuild/pull/314
This fixes the scenario of switching builds using RTM and Update 1.
Normal usage this should only be for an uninstall scenario since MSBuild is typically in the GAC,
but in cases of a checked in toolset or using the open source version we should be backwards compatible.
This is just renaming the fields back for the cache classes.
https://github.com/Microsoft/msbuild/pull/466
Update ResGen Serialization Compat for RTM and U1
602201c When reverting the CodeFormatter private field name changes (#314), the Dependencies class was missed. This causes an incompatibility going from Update 1 back to RTM and causes a null ref. This change fixes the compat issue (rename the field) and updates the serialization version to ensure U1 -> U2 works as expected.Rename field for internal build.
c863538 Looks like the field was renamed for STANDALONEBUILD but not otherwise.Correcting this.http://stackoverflow.com/questions/31608319/msbuild-error-msb4018-in-vs2015-the-link-task-failed-unexpectedly
9down voteaccepted | I've managed to fix this issue myself and would like to document the solution here for future reference. The following error was caused by an empty XML element in the project file: MSB4018: System.NullReferenceException: Object reference not set to an instance of an object. The empty element was accessed by the 'Link' task, which just failed: MSB4018: 'The "Link" task failed unexpectedly. Removing the respective element fixed the issue: <Link><GenerateDebugInformation></GenerateDebugInformation></Link> Hint: As it can be seen in other posts, many of the MSB4018 errors seem to be related to project files containing unexpected values. |
2down vote | Another solution is to delete all generated files from the last build through an explorer window. Delete all files in: .\Project\bin .\Project\obj While you can "Clean" or "Rebuild" directly through Visual Studio, this only captures some of the files. By forcing to recompile all files, all memory locations will now correctly align and the issue should be resolved. |
MSBuild and its Toolset now Version with Visual Studio
相关文章推荐
- 关于The "GenerateResource" task failed unexpectedly.的报错
- The "GenerateResource" task failed unexpectedly. a generic error occured in GDI+
- vs2010:error MSB4018 “CL”任务意外失败 (The "CL" task failed unexpectedly. )
- ios在真机上调试时出现“Error launching remote program: failed to get the task for process xxx"解决办法(转)
- mt.exe : general error c101008a: Failed to save the updated manifest to the file "Debug\Resource.dll.embed.manifest". Bpo
- The Wind River Registry on host "localhost" died unexpectedly
- WARNING rally.common.broker [-] Failed to consume a task from the queue: The resource could not be found. (HTTP 404)
- ios在真机上调试时出现“Error launching remote program: failed to get the task for process xxx"解决办法
- git push error: RPC failed; result=56, HTTP code = 0 ,the remote end hung up unexpectedly
- 真机上运行项目时,出现Could not launch "FeedMeWorms" failed to get the task for process 3118
- 【xcode】错误之Could not launch "" failed to get the task for process
- 在真机上调试时出现“Error launching remote program: failed to get the task for process xxx"的解决方法
- XCode Could not launch "" failed to get the task for process
- 【xcode】错误之Could not launch "" failed to get the task for process
- 真机调试出现Could not launch "FeedMeWorms" failed to get the task for process 3118
- XCode Could not launch "" failed to get the task for process
- fatal: The remote end hung up unexpectedly error: failed to push some refs to ''
- vs里报error MSB4018: The "CL" task failed unexpectedly解决方法
- XCode Could not launch "" failed to get the task for process