ServiceStack/ServiceStack — pull request #593 by bchavez (2013-04-12 07:39:15+00:00)
Title: Razor1 removal and cleanup

## In this Pull Episode ... Razor1 is removed

Continuing with #583.

* Some critical RazorRockstars.Web references that were being worked on were pointing to NuGet packages.
-- Example: `ServiceStack.dll` was referenced from NuGet. Changed this to point directly to the ServiceStack.csproj project build output.

* Removed ServiceStack.Razor project.

* Moved all types in ServiceStack.Razor2.dll into a non-conflicting namespace Razor2. Previously, Types in ServiceStack.Razor2.dll had ServiceStack.Razor.* namespace.

* Updated build.bat with new Razor2 project references.

* Misc typos fixed.

#### Notes
* `RazorRockstars.Web` **works** with this pull request.
* A lot of the unit tests in `ServiceSTack.ServiceHost.Tests\Formats_Razor` do not work. I think these tests fell off the train a long time ago before I started working on Razor. Let me know if I should fix these up too.

## Other Minor Notes

### Null Reference Exception on ServiceStackHandlerFactoryPath

There's a `NullReferenceException` exception in `ServiceStack.RazorHostTests` that occurs in `PathUtils::CombinePaths()`. The null reference path comes from `EndpointHost.Config.ServiceStackHandlerFactoryPath`.

Ultimately, I traced this down to be possibly a bug in `EndpintHostConfig::SetPaths()` @mythz, you might want to check that out since that's a change in core. `SetPaths()` leaves `instance.ServiceStackHandlerFactoryPath` null when the handler path pulled from web.config handlers section having a value of `path="*"`.

You can see the null reference exception in when you hit the `ServiceStack.RazorHostTests` project's URL:
http://localhost:23711/json/metadata?op=Rockstars

UPDATE: I think you fixed this in b98e9de8a1b5c46633f7a7fe3337b4e0e0649c87

### An item with the same key has already been added

An `ArgumentException` is thrown when the `ServiceStack.RazorHostTests` project starts up and tries to "precompile" the pages.

This is caused by two files named `Rockstars.cshtml` in different directories. `\Embedded\Views\Rockstars.cshtml` and `\Views\Rockstars.cshtml`. When `AddPage()` -> `AddViewPage()` is called for the second `Rockstars.cshtml` page (with the same name), an `ArgumentException` is thrown. The exception is caught, and `HandleCompilationException()` handles the exception.

As the exception is being cought with `catch{}`:`HandleCompilationException` tries to be helpful and compile the page, only to find, there's a compilation error in the second `Rockstars.cshtml` that causes a second exception INSIDE the ***parent*** `catch{}` from the origional `ArgumetnException`.

Ultimately, because these two recursive exceptions, `RazorFormat()` bails out from `Configure()` and never loads.

@mythz -- not really sure how you want to handle "embedded" views with the same file name. I think this really makes the case for a serious refactroing.

Hopefully, you can accept this pull request, and next I will go in and start refactoring `RazorFormat`.

### Remove empty projects

What are `ServiceStack.Common/Interfaces`, `Android`, `SL4`, `SL5`, `WinRT`, `WP` for?

All these projects are blank projects / folters with nothing in them. Personally, I'd like to remove these folders. **IMHO**, they don't do anything except clutter up the `\src` directory. In an effort to make `\src` proper and run a clean ship; *we should remove them if there's no implementation*

### test/RazorRockstars Console and Console.Files

What's the difference between `test/RazorRockstars.Console` and `test/RazorRockstars.Console.Files`? They looks similar. And also note that `test/RazorRockstars.Console` is an orphaned project and not part of `Solution.sln`.