Build errors after installation

May 21, 2012 at 9:41 PM

Hi there.

I just installed it on a new MVC 4 empty app, and then get the following compilation errors.

Any tips?

------------------------------------------------

The type or namespace name 'ArgumentMapBinder' could not be found (are you missing a using directive or an assembly reference?)   
The type or namespace name 'ArgumentMapUrlBinder' could not be found (are you missing a using directive or an assembly reference?)   
The type or namespace name 'PersistArgumentMapBinder' could not be found (are you missing a using directive or an assembly reference?)   
The type or namespace name 'ReservedArgumentsBinder' could not be found (are you missing a using directive or an assembly reference?)   
The type or namespace name 'SingleValueArgumentBinder' could not be found (are you missing a using directive or an assembly reference?)   
The type or namespace name 'SingleValueArgumentUrlBinder' could not be found (are you missing a using directive or an assembly reference?)   

Output from installation:

--------------------------------------------------

Package Manager Console Host Version 1.7.30402.9028

Type 'get-help NuGet' to see all available NuGet commands.

PM> install-package restfulobjects.server -pre
Attempting to resolve dependency 'NakedObjects.Surface.Nof4 (≥ 0.8.0-beta)'.
Attempting to resolve dependency 'NakedObjects.Framework (≥ 4.0.306.0)'.
Attempting to resolve dependency 'NakedObjects.ProgrammingModel (≥ 4.0.306.0)'.
Attempting to resolve dependency 'NakedObjects.Ide (≥ 4.0.306.0)'.
Attempting to resolve dependency 'log4net (= 1.2.11)'.
Attempting to resolve dependency 'EntityFramework (≥ 4.2.0.0)'.
Attempting to resolve dependency 'NakedObjects.Surface (≥ 0.4.0-beta)'.
Attempting to resolve dependency 'RestfulObjects.Mvc (≥ 0.21.0-beta)'.
Attempting to resolve dependency 'AspNetWebApi (≥ 4.0.20126.16343)'.
Attempting to resolve dependency 'AspNetWebApi.Core (≥ 4.0.20126.16343)'.
Attempting to resolve dependency 'System.Net.Http.Formatting (≥ 4.0.20126.16343)'.
Attempting to resolve dependency 'System.Net.Http (≥ 2.0.20126.16343)'.
Attempting to resolve dependency 'System.Web.Http.Common (≥ 4.0.20126.16343)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.4)'.
Attempting to resolve dependency 'WebActivator (≥ 1.5)'.
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'.
'RestfulObjects.Server 0.15.0-beta' already installed.
Successfully added 'NakedObjects.Ide 4.0.306.0' to SMD.Core.RestfulRunner.
Successfully added 'NakedObjects.ProgrammingModel 4.0.306.0' to SMD.Core.RestfulRunner.
Successfully added 'log4net 1.2.11' to SMD.Core.RestfulRunner.
Successfully removed 'EntityFramework 4.1.10331.0' from SMD.Core.RestfulRunner.
Successfully added 'EntityFramework 4.2.0.0' to SMD.Core.RestfulRunner.
Successfully added 'NakedObjects.Framework 4.0.306.0' to SMD.Core.RestfulRunner.
Successfully added 'NakedObjects.Surface 0.4.0-beta' to SMD.Core.RestfulRunner.
Successfully added 'NakedObjects.Surface.Nof4 0.8.0-beta' to SMD.Core.RestfulRunner.
Successfully added 'Newtonsoft.Json 4.5.5' to SMD.Core.RestfulRunner.
Successfully added 'RestfulObjects.Mvc 0.21.0-beta' to SMD.Core.RestfulRunner.
Successfully added 'WebActivator 1.5' to SMD.Core.RestfulRunner.
Successfully added 'RestfulObjects.Server 0.15.0-beta' to SMD.Core.RestfulRunner.
Successfully uninstalled 'EntityFramework 4.1.10331.0'.

Coordinator
May 22, 2012 at 7:34 AM

This code is currently in the wrong namespace - so to fix add 

using MvcTestApp.Controllers;

It will move into the correct namespace when I push out the next package.


May 22, 2012 at 7:40 AM

Ok, thanx, that worked.

Strange. I tried adding a using with VS's smart tags on the unrecognised name, but it didn't find anything automatically. That's why I thought there was a bigger problem. It was probably just still figuring stuff out internally. :)

 

Tnx

May 22, 2012 at 7:49 AM

 

Next problem.

Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Coordinator
May 22, 2012 at 8:03 AM

For a workaround  go to the bin directory and delete 'NakedObjects.Authorisation.Wif.dll'.

There seems to be a change beween MVC3 and MVC4 in how dll dependencies are handled. This code depends on WIF but is not running unless you've configured WIF. Previously the dependency was just ignored when ASP.NET loaded the dlls, now it causes a failure.

As a result we have a ticket and in the next framework release we will move WIF code into a separate optional package as part of MVC4 compatibility changes. 

 

May 22, 2012 at 9:41 AM

Perfect. THanx. It is working now.

PS Do you know if it is possible to add views to the restful running project to deliver the HTML for a single page app? In that way I can also handle authentication in 1 project.

Coordinator
May 22, 2012 at 12:21 PM

For a single-page app you can just include the .htm for the index page in the RestfulObjects run project and then access that via the server.  If you mean specifically that you want to include .aspx views, then, yes it is possible to combine RO with conventional MVC in the same server.  You just need to distinguish them at the routing level.

N.B.  I did make a start on a single page app some while ago, and the code is all there in the repository, if you want to look at it, but I can't say for sure that it is actually running at present, as it was only ever experimental, not tested  -  and the RO spec did move after that.