Access to the path “/etc/mono/registry” is denied

Turns out simply creating the folder using mkdir sudo mkdir /etc/mono/registry and setting the right permissions using chmod sudo chmod uog+rw /etc/mono/registry does the trick. However I still don’t understand where such a folder is hidden in Ubuntu and why it doesn’t need to be created there, as well as why it isn’t created automatically … Read more

Where are the symbols for ASP.NET MVC 4.0 RTM?

Just add a symbol server that serves more then just major releases. Try this one, contains most minor builds. http://srv.symbolsource.org/pdb/Public Verify: Run VS as administrator. Check that something have been downloaded to your symbol cache directory. Goto select only specified modules. Add “System.Web.Mvc.dll” Set a break point in your code. Start debug. When break point … Read more

ViewModels or ViewBag?

Basically, Should everything be done through the viewmodel or is it Ok to also incorporate viewbag? Everything should be done inside a view model. That’s what a view model is. A class that you specifically define to meet the requirements of your view. Don’t mix ViewBags with ViewModels. It is no longer clear for the … Read more

MVC 4 Beta side by side installation error

After installing MVC4 beta today, a few of my MVC 3 projects would not compile. (ModelClientValidationRule conflict) The fix was: Edit: ProjectName.csproj Change <Reference Include=”System.Web.WebPages”/> To <Reference Include=”System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL “/>

How to develop an ASP.NET Web API to accept a complex object as parameter?

By default complex types are read from body, that’s why you are getting null. Change your action signature to public IEnumerable<Users> Get([FromUri]MyApiParameters parameters) if you want the model binder to pull the model from the querystring. You can read more about how Web API does parameter binding in the excellent article by Mike Stall from … Read more

How am I supposed to use ReturnUrl = ViewBag.ReturnUrl in MVC 4

When using forms authentication and the user is not authenticated or authorized the ASP.NET security pipeline will redirect to the login page and pass as a parameter in the query string the returnUrl equal to the page that redirected to the login page. The login action grabs the value of this parameter and puts it … Read more