Um blog sobre nada

Um conjunto de inutilidades que podem vir a ser úteis

Visual Studio + Deployable Dependencies

Posted by Diego em Setembro 15, 2012


So there I was deploying my Web Application, MVC + Razor + EF + everything else when I got this error:

Parser Error Message: Could not load file or assembly ‘System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

clip_image002

Ah, dll errors!!!

Instead of coping manually the dlls or setting the “copy local” property to true, I decided to let Visual Studio S do that for me by adding the deployable dependencies for razor:

clip_image003

After doing that, my application, that was working perfectly, started to show this error message:

The controller for path ‘/Account/Login’ was not found or does not implement IController.

Then I thought: “WTF! I didn’t change anything…and most important, I don’t have any reference to a /Account/Login page”!!

After a long research, I found out that when you add “deployable dependency” and check “ASP.NET Web Pages with Razor Syntax”, it adds a reference to the WebMatrix.WebData.dll
This dll has a class with a static constructor that does the following:

 

static FormsAuthenticationSettings()
{
       FormsAuthenticationSettings.LoginUrlKey = "loginUrl";
       FormsAuthenticationSettings.DefaultLoginUrl = "~/Account/Login";
}

So the solution is to delete the reference to the WebMatrix.WebData.dll and WebMatrix.WebData.xml and delete it from the bin folder (you must manually delete it, a “clean” on the solution won’t do it).

Just as a FYI, there is another assembly called WebMatrix.Data.dll. This doesn’t seem to cause any issues.

Deixe uma Resposta

Preencha os seus detalhes abaixo ou clique num ícone para iniciar sessão:

Logótipo da WordPress.com

Está a comentar usando a sua conta WordPress.com Terminar Sessão / Alterar )

Imagem do Twitter

Está a comentar usando a sua conta Twitter Terminar Sessão / Alterar )

Facebook photo

Está a comentar usando a sua conta Facebook Terminar Sessão / Alterar )

Google+ photo

Está a comentar usando a sua conta Google+ Terminar Sessão / Alterar )

Connecting to %s

 
%d bloggers like this: