I am using VS 2010 , when I want to create entity model, the entity model wizard closes with no error, when I choose from Database...I could not understand the reason and also no idea how to solve this problem?
Have you installed any third party add-ins in VS2010? Please try to launch VS2010 in Safe Mode and test the behavior again to avoid any third party add-ins’ effect. For detail, please see http://msdn.microsoft.com/en-us/library/ms241278.aspx.
Besides, are there any problems when you create a new Entity Data Model? Here is a tutorial about how to create an Entity Data Model, http://learnentityframework.com/LearnEntityFramework/tutorials/creating-an-ado-net-entity-framework-entity-data-model/.
hope this works .
Related
I'm working on a .NET MVC web app using Entity Framework 6 to manage a model from a SQL Server database. I've been using VS 2017 to develop everything so far, making changes to the database, and updating the model after those changes are made. When I switched to VS 2019 and attempted this, only the model and diagram of the model were updated. The classes generated by EF were not updated with the changes from the database. Does VS 2019 handle EF models differently than 2017?
According to this thread on VS Developer Community, it will be fixed in VB2019.1, in the meantime there's a workaround:
Save the .edmx file
Expand the .edmx file in Solution Explorer
For each .tt files inside it, right-click and choose Run Custom Tool.
For what it's worth, I'm experiencing exactly the same issue. The EDMX file gets updated as expected, but additional fields aren't being added to the generated class...
Reopening the project in VS 2017 works, suggesting that something has changed within VS itself.
I am having a problem with Visual Studio 2013.
I start by creating a new project, a ASP.NET Web Application MVC. Then when i try to add a ADO.NET Entity Data Model i get this error:
I had this problem before, but i updated Windows Server, which im using, and Visual Studio too, and it stay good. But now i updated a Sql Server Tools in VS, and this error appears again.
This all happened because i am having a problem, which is, when i try to add a ADO.NET Entity Data Model the wizard closes at the middle of the process. I have searched inumerous posts here on StackOverflow but nothing resolved.
I am using .Net Framework 4.5 and Entity Framework 6
If somebody could help i would be eternally grateful
Ok, the error is gone, i just removed the Update 5 from Visual Studio and it's fine now.
But now there is the other error, when i try to create a ADO.NET Entity Data Model, at the middle of the process, the wizard just closes and the Model it's not created.
Any suggestions?
Using Visual Studio 2013, create a new ASP.NET Web Application project using the MVC template. Verify that the Add View dialog functions by right-clicking the "Views\Home" folder and choosing "Add... View".
Now add a new F# Library project to the solution. The Add View dialog should still function correctly.
Now add a project reference from the MVC project to the F# project by right-clicking the References folder, choosing Add Reference, Then browse to Solution...Projects on the left and checking the F# library project that you just added.
At this point, if you right-click the "Views\Home" folder and choose "Add... View" you will get an error in a pop-up alert box instead of the Add View dialog:
There was an error running the selected code generator: 'Object reference not set to an instance of an object.'
Workarounds include, but are hopefully not limited to:
Remove all your references to any F# projects every time you want to add a new view.
Unload any referenced F# projects, but leave the project references in place, every time you want to add a new view.
My questions are:
Are other people seeing this behavior, or is it just me?
Does anyone know of a better work-around than removing references or unloading F# projects?
Does anyone know if Microsoft is already working on fixing this? If not should this be reported to the F# team or the Visual Studio team?
Between this issue and the fact that it is still impossible to use NuGet to add an Entity Framework 6 reference to any F# project, I'm starting to get nervous about Microsoft's level of commitment to the F# language.
Not sure if this will help you but check the version of EntityFramework in your solution. I had two projects within my solution and for whatever reason, the web project had EF 6 and the class library project was EF 6.1. Once I uninstalled EF completely from the solution and reinstalled EF 6.1 on both project, the "Add new view" action started working.
I received the same error message when adding views or controllers in a C# & MVC multi-project solution, using EF 6.1 and VS2013 with Update 3. The problem was because the nuget "packages" folder was marked as read only, because it was checked into source control. I checked the entire folder out, making it editable, and it started working fine, allowing me to scaffold straight from VS.
I also received the error message in a web.api project because I forgot to add the Entity Framework connection string to the web.config (it was using Areas and EF was looking in the Area web.config, not the web.config in the root).
I am using Visual Studio 2012. I created a Class project and added EF data model to this project. I created the data model from an existing SQL Server Database. I created a MVC 4 project, added entity connection string to web config, and added data project reference.
All is good to this point.
Now I want to add a MVC controller using Entity Framework. I select a one of the model classes. I select the data context class. Click Add.
VS pops an error up, the last part of the error message is class might be in a compiled assembly {which is true}.
'AA' is not part of the specified 'aanamespace.aaEntity' class and the entity class could not be modified to a DbSet property to it. For example the 'aaEntity' might be in a compiled assembly
I was in the same situation and I created a class library and in it i have all my .edmx and when i have a reference to my mvc project i got the exact the same error message i have posted my question here (stackoverflow.com/questions/18552864/…)
How did I fix:
Close the Visual Studio and open it again...
I want to take the time to answer this question myself so that others with a similar problem can be helped in the future.
Here is what I did.
Created the .edmx file in my Models folder of my MVC project.
Built the MVC project
Now I can add a controller for any of the tables in the .edmx file.
Note:
I thought the best practice was to create a project within my solution that holds the .edmx file. I called this project myData.
I added a reference to this project in my MVC project and tried this scaffolding without luck.
I hope this helps others because the solution is so simple.
Gerry
The problem was caused by the VSCommands for Visual Studio 2012 (Early Access) extension. Once I uninstalled it the problem disappeared.
Run Visual studio (Run as administrator) works for me.
Without seeing the exact error, I can only suggest a problem I experienced with the EF controller scaffolding and how I got around it. If you have extended your EF context class with a partial class, you will have to remove the latter from your project and recompile before generating the controller, otherwise EF scaffolding refuses to work.
Although this is a very old question, but there maybe people like me still facing the same issue which none of the suggested solutions can help them.
The reason for this error message when creating a new controller/scaffolding is the version of your EntityFramework.
HOW TO FIX:
if your project is MVC4 then you should use entity version 5.
if you use Entity version 6 you will face this issue.
remove your .edmx file and add your EntityFramework version 5.
it will work as expected.
This question is related to this one.
I’m trying to build a Vs package that’ll add context menu to the project of a specific type. Actually, I’m trying to achieve the exact thing MVC3 has. MVC3 project shows different context menus depending on which folder within the project is currently selected. For “Controllers” folder you’ll get a menu item to create Controller, and for “Views” folder you’ll get a menu item that triggers wizard for Views.
Maybe someone knows if MVC3 Vs Package sources are open? I thought they are as MVC itself is open and one can get sources easily. But I couldn’t find sources for MVC3 Vs Package…
Thank you SO in advance.
The features you describe are a bit more than simple VSPackages. Those are actually implemented in a separate binary, which can be downloaded, it is called ASP.NET MVC3 Tools Update. You can read more about it here.
The custom context menus are all defined and associated with the project type GUID. The MVC3 GUID is
{E53F8FEA-EAE0-44A6-8774-FFD645390401}
and the MVC2 project type GUID is
{F85E285D-A4E0-4152-9332-AB1D724D3325}.
So if you want to do such customizations, you do not have the MVC3 Tools binary's source for reference. I do not see it in Codeplex MVC sources anyway. You have to go to the pain of creating a ProjectType and this may help you do just that