title: Combination of Dynamic Data Entities Web Application Template and Asp.Net Web Forms Template
body: <p>I would like to create a website using Visual Studio 2012 For Web which has a database and a generated UI such as we have if we use the template project:</p>
  
  <p>Dynamic Data Entities Web Application</p>
  
  <p>But I would also like to have a login page such as provided by the template project:</p>
  
  <p>Asp.Net Web Forms Application</p>
  
  <p>I have found that the templates are great for either of these tasks but are pretty bad if you want both of them. </p>
  
  <p>If I start with the Dynamic Data Entities Web Application template then I get great pages for the data base side with very little coding to do - but I cannot manage to get the login code working (also, I don't think I should be writing that code anyway, since it already exists in the Asp.Net Web Forms Application). Whenever I try I get into a hideous mess. I don't really want to learn about authentication and membership and cookies or "how it does it" or any of that stuff. What I want is for the .Net framework to handle all of that and just tell me what the username is of the person looking at the page. That's all. And there is a way to do it, with the Asp.Net Web Forms Application template.</p>
  
  <p>But if I start with the Asp.Net Web Forms Application template then the login stuff works out-of-the-box ... but then I get into a hideous mess trying to create a UI for the database! But that should not be necessary given that that code already exists in the Dynamic Data Entities Web Application template. Again, I don't really want to learn how it does it, I just want to use it to do the stuff for me so that I don't have to. I don't want to have to tell it how to update, delete etc... and I don't have to with the Dynamic Data Entities Web Application template, but then I can't get the login stuff.</p>
  
  <p>Anyhow, I have torn out most of my hair with what I thought would be a pretty simple task: Create a website with login/registration with a simple database using the Code First Entities approach. My experience has been that if you want to have a database but no login then you are laughing. If you want to have a login but no database UI then you are laughing. If you want to have both then there is a lot of pain ahead unless you are a super duper Microsoft technology expert who lives and breathes this stuff.. or you know the "trick" (which probably exists in some forum somewhere).</p>
  
  <p>Anyway, my question is, what am I missing here? Is there a website with a whole bunch of other templates which does have the template that combines the Web Forms (with automated login/membership control) with the Dynamic Data Entities Web Application which does a great job of displaying the tables and allowing editing? I find it difficult to believe that Microsoft intended that I have to know how to do all of the stuff that Dynamic Data Entities Web Application does and that Asp.Net Web Forms Application in order to get both functionalities.</p>
  
  <p>It took me a week to figure out how to get "Enable-Migrations" to work in the Web Forms template type... Basically every small step has been a huge battle, requiring reading of forum after forum to discover little "tricks". But in the end, all I really want is a template that combines the Dynamic Data Entities Web Application  capability (i.e. data driven webpages) with the Web Forms capability (i.e. user login) and to publish it on Azure. I thought that would be simple. But it turns out that it has been a nightmare and in fact I am completely stuck.</p>
  
  <p>Update:</p>
  
  <p>I have just spent another half-day trying to get this to work following the advice on <a href="http://msdn.microsoft.com/en-us/library/ee923692(v=vs.100).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ee923692(v=vs.100).aspx</a> . But it does not work for me. It should not be so complicated. It should not require that level of tinkering to make such a common web site format: a database with UI and a login. </p>
  
  <p>Now I am back to the first problem I encountered a few days ago, which went away somehow, but I have no idea how:</p>
  
  <p>PM> Enable-Migrations
  System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))</p>
  
  <p>Server stack trace: 
     at EnvDTE.Properties.Item(Object index)
     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
     at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)</p>
  
  <p>Exception rethrown at [0]: 
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
     at EnvDTE.Properties.Item(Object index)
     at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue[T](Project project, String propertyName)
     at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName)
     at System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable(String contextTypeName)
     at System.Data.Entity.Migrations.EnableMigrationsCommand.&lt;>c_<em>DisplayClass2.&lt;.ctor>b</em>_0()
     at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
  The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))</p>
  
  <p>At this point I am going to give up. I have to give up, because after a week of trying I can manage to create website on Azure with a data base and UI but no login <em>OR</em> a website on Azure with login but no database UI. For me to create a grid view for every one of my tables, and hook up the RowChange, UpdateMethod, DeleteMethod etc... by hand (i.e. not using the dynamic data scaffolding) would be ridiculous given that the scaffolding exists (it is just too difficult to get it to work unless I use that template from the outset, but if I use that template then I don't have a login page!). Anyhow, now this  "The parameter is incorrect" error is popping up again so I am going around in circles.</p>