5

My ASP.NET MVC solution runs pretty well on VS2012. I installed VS2015 and my solution also works on it.... until I Clean then Rebuild the service inside it. Then if I run the solution, I got an error when trying to call the service (which is part of my solution)...

If I Clean then Rebuild the solution in VS2015 and run it again got the same error.

If I Clean then Rebuild the solution in VS2012, close it and open it again in VS2015 then it runs pretty well.

So it seems I need to Clean and Rebuild with VS2012 to be able to run it under VS2015. Very strange.

EDIT


The error is: System.ServiceModel.ProtocolException because the service is not returning the structured data as expected but rather some html (1024 first octets)... corresponding to an error page as below:

'

<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: '.

To be clear: the error described above is not the (real) cause of the problem because we know there is no need to reference System.Web.WebPages.Razor inside of services.

Bronzato
  • 9,438
  • 29
  • 120
  • 212
  • the fact that the visual studio 2015 does not work well with older versions of asp.net is a known bug, have you tried setting the minimum and current version in the solution file manually(to avoid migration)? – lkn2993 Nov 23 '15 at 17:26
  • @lkn2993: I can still open the solution with VS2012 or VS2015 so I think there is no migration. What do you mean by `setting the minimum and current version in the solution file manually`. Thanks anyway. – Bronzato Nov 24 '15 at 07:29
  • open the .sln file with text editor to see its details and then again maybe you need to set the settings in a way that vs2015 forces the migration. – lkn2993 Nov 24 '15 at 11:56

0 Answers0