Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.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
Visual studio 需要使用VS2012清理和重建我的解决方案,以便在VS2015上运行它_Visual Studio_Visual Studio 2015 - Fatal编程技术网

Visual studio 需要使用VS2012清理和重建我的解决方案,以便在VS2015上运行它

Visual studio 需要使用VS2012清理和重建我的解决方案,以便在VS2015上运行它,visual-studio,visual-studio-2015,Visual Studio,Visual Studio 2015,我的ASP.NET MVC解决方案在VS2012上运行良好。我安装了VS2015,我的解决方案也可以使用它。。。。直到我清理,然后重建其中的服务。然后,如果我运行该解决方案,我在尝试调用该服务时出错(这是我的解决方案的一部分) 如果我Clean,那么在VS2015中重建解决方案并再次运行,则会得到相同的错误 如果我Clean然后在VS2012中重建解决方案,在VS2015中关闭并再次打开它,那么它运行得非常好 因此,我似乎需要使用VS2012来清理和重建,以便能够在VS2015下运行它。很奇怪

我的ASP.NET MVC解决方案在VS2012上运行良好。我安装了VS2015,我的解决方案也可以使用它。。。。直到我清理,然后重建其中的服务。然后,如果我运行该解决方案,我在尝试调用该服务时出错(这是我的解决方案的一部分)

如果我
Clean
,那么
在VS2015中重建
解决方案并再次运行,则会得到相同的错误

如果我
Clean
然后
在VS2012中重建
解决方案,在VS2015中关闭并再次打开它,那么它运行得非常好

因此,我似乎需要使用VS2012来
清理
重建
,以便能够在VS2015下运行它。很奇怪

编辑


错误是:
System.ServiceModel.ProtocolException
,因为服务没有按预期返回结构化数据,而是返回一些html(1024个前八位字节)。。。对应一个错误页面,如下所示:

"


无法加载文件或程序集“System.Web.WebPages.Razor,Version=3.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”或其依赖项之一。系统找不到指定的文件。
正文{字体系列:“Verdana”;字体重量:正常;字体大小:.7em;颜色:黑色;}
p{字体系列:“Verdana”;字体大小:正常;颜色:黑色;页边顶部:-5px}
{字体系列:“Verdana”;字体大小:粗体;颜色:黑色;页边顶部:-5px}
H1{字体系列:“Verdana”;字体重量:正常;字体大小:18pt;颜色:红色}
H2{字体系列:“Verdana”;字体重量:正常;字体大小:14pt;颜色:褐红色}
前{字体系列:“控制台”,“Lucida控制台”,单空格;字体大小:11pt;边距:0;填充:0.5em;线条高度:14pt}
.marker{字体大小:粗体;颜色:黑色;文本装饰:无;}
.version{color:gray;}
.错误{页边距底部:'。

需要明确的是:上述错误不是真实的问题的原因是因为我们知道不需要在服务内部引用
System.Web.WebPages.Razor

visual studio 2015不能很好地与旧版本的asp.net配合使用是一个已知的错误,您是否尝试过在解决方案文件中手动设置最低版本和当前版本(以避免迁移)?@lkn2993:我仍然可以使用VS2012或VS2015打开解决方案,因此我认为没有迁移。手动设置解决方案文件中的最低版本和当前版本是什么意思?。无论如何,谢谢。使用文本编辑器打开.sln文件以查看其详细信息,然后可能需要以VS2015强制的方式再次设置设置他喜欢移民。
<head>

    <title>Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</title>

    <meta name="viewport" content="width=device-width" />

    <style>

     body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 

     p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}

     b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}

     H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }

     H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }

     pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}

     .marker {font-weight: bold; color: black;text-decoration: none;}

     .version {color: gray;}

     .error {margin-bottom: '.