Monday, August 27, 2012

MVC 4.0

I am writing this post as I contemplate re installing windows completely. Yes it is that kind of post, I have gone nearly 4 days without being able to do any actual work due to me "upgrading" to MVC 4.0.

So one of the features that was touted about upgrading to MVC 4.0 was that you would have no problem running older apps. Except according to Microsoft's known issues with MVC 4.0 it states the following;

Installing ASP.NET MVC 4  breaks ASP.NET MVC 3 RTM applications. 


Um last I checked that is not the same as runs with older apps no problem, as a matter of a fact it is the exact opposite.

So what kind of error did I see, my solution fails to even load and I get no stack trace. Good problems indeed. So I then decided it was time to uninstall MVC 4.0 and come back at a later date because the project had no intentions of updating to 4.0 yet. Uninstall and I still get the same issue...uh oh something else major has happened.

Ok maybe the update changed my project in some way, easy fix, blow away the project and re-checkout the latest code.


Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Wait....WTF? I never updated the code I was using to me an MVC 4 application. Why are you looking for this now? Ok let me search in my code for the reference. 0, ziltch, goose egg. That is the number of times that I have found that reference in the solution.

Next step, system restore to before the install. Luckily that was less than 12 before I figured this step out. Run the restore and now I get another fun error.

System.ObjectDisposedException

Which when you Google gives you all of nothing for information on how to fix the issue. Seriously at this point I was about ready to sacrifice a goat to Cthulhu or the Flying Spaghetti Monster if I thought it would help.  Some where is calling  dispose() in the wrong order, fun part though is I can''t set a break point. I get this error as soon as I open the solution.
So here is the real fun, my coworker is running the application just fine, never did the update. I can open any other app, as long as it is not MVC 3.0 and now I am at a crossroads. Do I keep uninstalling all things MVC and build back up, system restore to some time last week, or re install windows? 

I will be back to update this post once I fix this stupid issue.

Thursday, July 19, 2012

Report Builder 3.0 and SSRS 2008

So I went looking for a tool to help me build out reports. I found Report Builder 3.0, http://www.microsoft.com/en-us/download/details.aspx?id=6116.


This is very helpful to build out and test your reports. Everything is a happy time, until you go to upload your report. If you are running Version 2008 of SSRS you get this nice message.

The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition' which cannot be upgraded. (rsInvalidReportDefinition)


WTF does that mean? Well the short answer is that the report builder uses the 2010 schema, and our server is a 2008. Upgrading the server is not an option, so I have to find another solution. First thing I do is look at the RDL in question in notepad++ and compare it to a valid RDL that I pull from the server. They are vastly different, I mean night and day different. There is no way that these two RDL's are the same. So I download the RDL I want to modify again, and check it in notepad++. Looks good. Open in report builder, save, open in notepad++. WTF?!?! The changes are back!


I start to examine the files and notices that they are different, but the same. For the most part, things have just been rearranged. Hence the night and day differences. Then at the very top the schema definition is 2010 and the old has 2008.


That is when I dig in, knowing there has to be a way to fix this by hand. Sure enough there is.


Replace the 2010 header with;

<Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" 
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition">

Then do a find for the following tags; 
<ReportSections> <ReportSection> </ReportSections> </ReportSection>


Now remove just the tags! Keep the body in the report. Now upload. Seriously, that is it. The report now works, no need to have VS 2008 installed to do your report building, and no need to upgrade the server just to use the tool.


Seriously, WTF?!