75692

Visual Studio - Default code generation is disabled

Question:

I am trying to follow this tutorial that uses the Entity Data Model.<br /><a href="http://www.entityframeworktutorial.net/create-first-simple-EDM.aspx" rel="nofollow">http://www.entityframeworktutorial.net/create-first-simple-EDM.aspx</a><br /> It tells me to open the Model1.designer.cs file.<br /> I should see a bunch of C# code but all I see is:

// Default code generation is disabled for model 'c:\users\dewi jones\documents\visual studio 2012\Projects\dewi_test\dewi_test\Dewi_Model.edmx'. // To enable default code generation, change the value of the 'Code Generation Strategy' designer // property to an alternate value. This property is available in the Properties Window when the model is // open in the designer.

I have tried to enable code generation but I can't figure out how. I can't see it in the project properties :( I am new to Visual basic and would greatly appreciate help. Thanks

Answer1:

Open the <a href="http://msdn.microsoft.com/en-us/library/vstudio/bb738483%28v=vs.100%29.aspx" rel="nofollow">Model Browser Window</a> of your entity model in Visual Studio, navigate to Properties window(hit [F4]) and change the Code Generation Strategy to Default

<img alt="Model Properties Window" class="b-lazy" data-src="https://www.codeproject.com/KB/WCF/350488/10.PNG" data-original="https://www.codeproject.com/KB/WCF/350488/10.PNG" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />

Recommend

  • Absolute div overlay iframe borders?
  • CDbCriteria condition from another CDbCriteria
  • Text mining - extract name of band from unstructured text [closed]
  • Use Django's models in a Scrapy project (in the pipeline)
  • Add entity to json in mvc controller
  • PowerShell CSV manipulation
  • Can I include a Generic type parameter in a lamba expression? (VB.NET 2010)
  • Installing a python package in a desired folder
  • How to add a resource file to Visual Studios so that it's visible in “Select Resource” dialog?
  • ImportError: cannot import name COMError in python
  • Hatch area using pcolormesh in Basemap
  • Delphi. Analog of Memo/RichEdit
  • Where in the relevant specification is it documented that some comments in a SQL script are, in fact
  • java.net.SocketTimeoutException on embedded tomcat with jersey
  • Where to save the local DB created for iphone app?
  • Why isn't \\\\ interpreted as a blackslash in this regex?
  • Is it possible to create a self-extracting archive which will run a specific file when unzipped?
  • How to work with Master Page that is attached to the page via the page's basepage?
  • Reading XML into Datatable gives incorrect DateTime when the time has Time Zone info
  • NRefactory: How do I access unresolved Named Arguments on a Property Attribute?
  • 'doc_del_count' bigger than 'doc_count' on CouchDB
  • c# winform DrawToBitmap offscreen
  • Changing Jupyter Notebook start up folder by modifying “start in” not working any more
  • Alamofire and Reachability.swift not working on xCode8-beta5
  • Looking for good analogy/examples for monitor verses semaphore
  • How to match http request and response using Jersey ContainerRequestFilter and ContainerResponseFilt
  • Why HTML5 Canvas with a larger size stretch a drawn line?
  • Spray.io: When (not) to use non-blocking route handling?
  • Modifying destination and filename of gulp-svg-sprite
  • GridView Sorting works once only
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • How do I rollback to a specific git commit
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Acquiring multiple attributes from .xml file in c#
  • coudnt use logback because of log4j
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How can I remove ASP.NET Designer.cs files?
  • java string with new operator and a literal