本文转自: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:

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.

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.

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.

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

[转]error MSB4018: The "GenerateResource" task failed unexpectedly的更多相关文章

  1. Visual Studio 2019 编译.Net Core Console项目出现【MSB4018 The "CreateAppHost" task failed unexpectedly】 错误

    需要测试一个小东东,使用Visual Studio 2019新建了一个.Net Core的Console程序,但是在编译的时候一直报错,死活编译不通过. 错误信息: Severity Code Des ...

  2. VS中warning MSB8004和error MSB4018解决方案

    问题如下: warning MSB8004: Output Directory does not end with a trailing slash.  This build instance wil ...

  3. Sqoop导入数据到mysql数据库报错:ERROR tool.ExportTool: Error during export: Export job failed!(已解决)

    问题描述: Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Conta ...

  4. nova instance出错:"message": "Proxy error: 502 Read from server failed

    执行 $ nova resize instance1 时候出错: {, "details": " File \"/opt/stack/nova/nova/com ...

  5. Error Domain=ASIHTTPRequestErrorDomain Code=8 "Failed to move file from"xxx/xxx"to"xxx/xxx"

    今天真的好高兴呀 我解决了一个折磨了我一周的问题,真的是激动地要哭出来了,为了这个问题,我嘴也烂了,头发抓了一地啊.虽然解决方法,最后还是展现出了“百度”的伟大,但是我还是很开心,在这里我展示一下我的 ...

  6. Activiti6.0 安装出错 log4j:ERROR setFile(null,true) call failed.

    由于要选择一款合适的流程引擎,需要在jbpm和Activiti之间做对比,我这边负责Activiti的测试. 看到Activiti官网(http://www.activiti.org/download ...

  7. log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: ..\logs\2010-1-19.log (系统找不到指定的路径。)

    log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: ..\logs\2010-1-19.log (系统找 ...

  8. JDE客户端get时报错“ERROR:fetch from table F0101 failed”

    客户端开发时发现总报错误“ERROR:fetch from table F0101 failed” 原因是用户ID在地址名册中找不到地址号.修改用户地址号即可.如下图所示

  9. log4j:ERROR setFile(null,true) call failed

    1.错误描述 log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: at java.io.FileOut ...

随机推荐

  1. ES6——数据结构 Map

    数据结构 Map 字典: 用来存储不重复key的 Hash结构.不同于集合(Set)的是,字典使用的是 [键,值] 的形式来存储数据的. JavaScript 的对应那个(Object:{}) 只能用 ...

  2. c# 委托与事件的区别

    委托与事件的区别 委托和事件没有可比性,因为委托是数据类型,事件是对象(可以理解为对委托变量的封装.),下面说的是委托的对象(用委托方式实现的事件)和(标准的event方式实现)事件的区别.事件的内部 ...

  3. Linux系统忘记管理员密码(CentOS、RHEL、Ubuntu)

    Linux系统忘记管理员密码(CentOS.RHEL.Ubuntu) 系统使用过程中,尤其是生产环境中.万一忘记管理员密码,该怎么办?是不是很绝望? 1.RHEL 7.0 重启主机进入引导界面键入e键 ...

  4. codeforces|CF1054D Changing Array

    因为数据范围是2e5级别的,所以我们考虑用异或前缀和来处理区间的异或情况.(比如说a包括b,那么我们通过异或可以知道b对于a的补区间的信息) 之后因为对任意\(a_i\)进行取反操作,会改变它和它之后 ...

  5. for循环 | range 对象

    # ### for循环 # 循环 遍历 迭代 # 把列表的元素一一的拿出来遍历 listvar = ["黄雄大","黄文","黄仪正",&q ...

  6. Android来电、去电监听

    Android手机中添加手机来电的状态,使用PhoneStateListener来监听. TelephonyManager telephonyManager = (TelephonyManager) ...

  7. [web]深入理解Session和Cookie

    一.理解Cookie 由于http是一种无状态的协议,当用户的一次访问结束后,后端的服务器就无法知道下一次来访问的请求是不是上一次的用户了.那么Cookie的作用就是用户通过http访问一个服务器时, ...

  8. linux入门 配置网络

    我因为有自己的ssr,因此想让虚拟机共享我的ssr,并且不想搞的太麻烦,特此记录一下 1. 获取本机的ip 在命令行里输入ipconfig /all 获取本机IP,如下图所示,我本机ip为10.3.7 ...

  9. 高阶篇:4.1.2)QFDII(设计要求逐层分配给各零件)

    本章目的:明确QFDII的作用:输入为设计要求(Design Feature),输出为零件特征(Part Characteristic),将设计要求分配到每一个零件特征中去: 本章开始介绍产品结构设计 ...

  10. 离线安装eclipse的maven插件包

    离线安装eclipse的maven插件包 1.打开你本地的eclipse根目录,随便新建一个文件夹例如mavenPlugin,把maven离线插件包中两个文件夹复制到这个新建的这个文件夹里边 2.找到 ...