当未能返回值时,C#Visual Studio 2012不会产生有用的编译错误,而VS 2010则会
复制步骤: 编译这段代码:当未能返回值时,C#Visual Studio 2012不会产生有用的编译错误,而VS 2010则会,c#,visual-studio-2012,C#,Visual Studio 2012,复制步骤: 编译这段代码: public string SomeMethod() { return; } Visual Studio 2012生成此无用的编译错误: Could not copy the file "<insert path of executable>" because it was not found. An object of a type convertible to 'string' is requ
public string SomeMethod()
{
return;
}
Visual Studio 2012生成此无用的编译错误:
Could not copy the file "<insert path of executable>" because it was not found.
An object of a type convertible to 'string' is required
Visual Studio版本:
- VS 2012:11.0.50727.1版
- VS 2010:10.0.40219.1版
我们在升级到VS 2012的同时升级到JetBrains ReSharper 7.0.1 C#Edition,但在暂停ReSharper的同时复制此版本会产生相同的结果。当我尝试使用版本11.0.50912.1时,我得到:“需要可转换为“字符串”类型的对象”VS2012有完全相同的消息。。。不知道你做了什么,但这里没有重做。对我来说,错误1是一个类型可转换的对象。你确定没有生成后的步骤造成另一个错误吗?@JonasW、Marc和Justin,谢谢你尝试重现。你们中有人安装了ReSharper吗?@JustinHarvey,为了测试,我从头开始在一个新的解决方案中创建了一个新项目,没有更改任何设置,也没有添加后期构建步骤。