This fixed my problem which was not being able to create a dynamic data website, create an entitymodel for some tables and just put the type into the commented line in the Global.asax file, change scaffold to true and then go, like I did it vs 2010. Now
I can do that, if I just add what u wrote to the list. THX!
I am still worried that I don't have the linq to sql version of the template any longer. Sure there is a way to get it working, but since it's not there anymore I think it's time to change to entitites. I just still think there are so many things I can't
do with linq to enitites as easily as in linq to sql. :'(.
I seem to have the same problem with my application. I implemented what you suggested. Then I choose Generate Database from Model. The error I am getting now is:
Error 4 The type or namespace name 'Vita_DataEntities' could not be found (are you missing a using directive or an assembly reference?) D:\WebSites\VITA-DYN\Global.asax 25 45 VITA-DYN(1)
I started this over again and I also tried the Adventure Works 2012 database and I get the same results after I delete TT files and change Code Generation to Default and then Generate Database from Model. I must be doing something wrong, but I have no idea
what it could be. Below is my error.
Compilation Error
Description:
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'AdventureWorksLT2012_DataEntities' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 24: // See http://go.microsoft.com/fwlink/?LinkId=257395 for more information on how to add and configure an Entity Data model to this project
Line 25: //DefaultModel.RegisterContext(typeof(YourDataContextType), new ContextConfiguration() { ScaffoldAllTables = false });
Line 26: DefaultModel.RegisterContext(typeof(AdventureWorksLT2012_DataEntities), new ContextConfiguration() { ScaffoldAllTables = true }); Line 27:
Line 28: // The following statement supports separate-page mode, where the List, Detail, Insert, and
uniprof
Member
267 Points
62 Posts
VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Sep 12, 2012 02:17 PM|LINK
run debug and get the error.
I beleive Microsoft didn't debug well prior to release with Dynamic data..............
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Sep 14, 2012 01:06 AM|LINK
Hello,
Would you mind sending me your code sample package so as to let me check with that?
My email is:v-dedong@microsoft.com
Please make sure that your package must be type of zip.
Your Email title should be ful-filled with your issue's title, in the body please attach your sample as well as your issue's URL.
Reguards!
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Oct 02, 2012 08:42 AM|LINK
Hi Uniprof, you have to change the code generation type in the EF data model.
1. Delete the TT files from the model
2. Change the "Code Generation Stategy" to "Default"
Always seeking an elegant solution.
Flem100
Member
2 Points
1 Post
Re: VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Oct 27, 2012 04:52 PM|LINK
This fixed my problem which was not being able to create a dynamic data website, create an entitymodel for some tables and just put the type into the commented line in the Global.asax file, change scaffold to true and then go, like I did it vs 2010. Now I can do that, if I just add what u wrote to the list. THX!
I am still worried that I don't have the linq to sql version of the template any longer. Sure there is a way to get it working, but since it's not there anymore I think it's time to change to entitites. I just still think there are so many things I can't do with linq to enitites as easily as in linq to sql. :'(.
mclayton
Member
32 Points
5 Posts
Re: VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Nov 06, 2012 09:18 PM|LINK
I seem to have the same problem with my application. I implemented what you suggested. Then I choose Generate Database from Model. The error I am getting now is:
Error 4 The type or namespace name 'Vita_DataEntities' could not be found (are you missing a using directive or an assembly reference?) D:\WebSites\VITA-DYN\Global.asax 25 45 VITA-DYN(1)
Any help would be appreciated.
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Nov 07, 2012 01:10 PM|LINK
Hi MClayton. this is the correct fix can you delete you data model and then recreate, after you have you model follow my steps and all should be good.
Always seeking an elegant solution.
mclayton
Member
32 Points
5 Posts
Re: VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Nov 07, 2012 04:39 PM|LINK
I started this over again and I also tried the Adventure Works 2012 database and I get the same results after I delete TT files and change Code Generation to Default and then Generate Database from Model. I must be doing something wrong, but I have no idea what it could be. Below is my error.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'AdventureWorksLT2012_DataEntities' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 24: // See http://go.microsoft.com/fwlink/?LinkId=257395 for more information on how to add and configure an Entity Data model to this project Line 25: //DefaultModel.RegisterContext(typeof(YourDataContextType), new ContextConfiguration() { ScaffoldAllTables = false }); Line 26: DefaultModel.RegisterContext(typeof(AdventureWorksLT2012_DataEntities), new ContextConfiguration() { ScaffoldAllTables = true }); Line 27: Line 28: // The following statement supports separate-page mode, where the List, Detail, Insert, andSource File: d:\WebSites\AdventureWorks2012\Global.asax Line: 26
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Nov 07, 2012 05:03 PM|LINK
Just Testing now
Always seeking an elegant solution.
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Nov 07, 2012 05:09 PM|LINK
Hi there MClayton, did you delete all the .tt file entitis and Context?
P.S. you do not need the update model from database step it just works.
Always seeking an elegant solution.
mclayton
Member
32 Points
5 Posts
Re: VS2012 RTM - Context type is not supported with ASP.NET dynamic data
Nov 07, 2012 05:52 PM|LINK
sjnaughton,
Thanks for your time it looks as if there is a couple of things I was doing wrong:
1. I needed to create as a Project and not a website, was able to get this to work with AdventureWork2012LT after going through your process.
2. Seems there is something wrong when I use my database specifically.