kahanu / MvcInstaller

Easily install your database schema and ASP.NET Membership system into your ASP.NET MVC application.
6 stars 2 forks source link

MvcInstaller 2.0 can't install ASP.NET Membership in ASP.NET MVC 4 app #2

Closed aknuds1 closed 12 years ago

aknuds1 commented 12 years ago

I am trying to install ASP.NET Membership in my ASP.NET MVC 4 application's database with the help of Mvc Installer 2.0 (installed via NuGet), but when I click MvcInstaller's 'Install' button I get an error message (highlighted in red) which I cannot make heads or tails of. I have configured MvcInstaller to use Entity Framework (I am on version 5).

Incorrect syntax near '?'. The identifier that starts with '.............}�\................................0......1............�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�./3==y�' is too long. Maximum length is 128. Missing end comment mark '*/'.
aknuds1 commented 12 years ago

I found out what the problem was. MvcInstaller is supposed to execute SQL scripts in App_Data, as it turns out though it'll execute anything in this folder. That there was an .mdf database file there explains the binary gibberish in the error message...

kahanu commented 12 years ago

@Arve, only .sql scripts that are in the App_Data folder are executed. But I haven't actually tested it with an .mdf file in that folder. In the future you can create a App_Data/Scripts folder and drop the .sql scripts in there, and then update the Installer.config file to reflect this change. This way it will only execute the files in the /Scripts folder and the .mdf file should not be touched.

Also, I have not tested this against EF 5.x.

Let me know if you have any other issues. Thanks.