Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当未能返回值时,C#Visual Studio 2012不会产生有用的编译错误,而VS 2010则会_C#_Visual Studio 2012 - Fatal编程技术网

当未能返回值时,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,为了测试,我从头开始在一个新的解决方案中创建了一个新项目,没有更改任何设置,也没有添加后期构建步骤。