ErikEJ / EntityFramework6PowerTools

This is the codebase for Entity Framework 6 Power Tools Community Edition, and modern EF 6 providers for SQL Server and SQL Server Compact
Other
183 stars 27 forks source link

no Generate Views available in context menu #68

Closed wout-de-jong closed 4 years ago

wout-de-jong commented 4 years ago

Hi Erik, I'm new to VS Community 2019, but I don't see the context meny entry mentioned in the Overview when I rightclick on an .edmx file in Solution Explorer (Folder View). Can you help out a bit?

image

Microsoft Visual Studio Community 2019 Version 16.4.5 VisualStudio.16.Release/16.4.5+29806.167 Microsoft .NET Framework Version 4.7.03056

Installed Version: Community

C# Tools 3.4.1-beta4-19614-01+165046097562cfe65b09c2e9a9d8f7cd88526f2c C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Entity Framework 6 Power Tools 0.9.2 Preview of useful design-time DbContext features, added to the Visual Studio Solution Explorer context menu.

When right-clicking on a file containing a derived DbContext class, the following context menu functions are supported: 1) View Entity Data Model (Read-only) - Displays a read-only view of the Code First model in the Entity Model Designer. 2) View Entity Data Model XML - Displays the EDMX XML representing the underlying Code First model. 3) View Entity Data Model DDL SQL - Displays the DDL SQL corresponding to the SSDL in the underlying EDM Model. 4) Generate Views - Generates pre-compiled views used by the EF runtime to improve start-up performance. Adds the generated views file to the containing project.

When right-clicking on an Entity Data Model (*.edmx) file, the following context menu function is supported: Generate Views - Generates pre-compiled views used by the EF runtime to improve start-up performance. Adds the generated views file to the containing project.

NuGet Package Manager 5.4.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

Visual Basic Tools 3.4.1-beta4-19614-01+165046097562cfe65b09c2e9a9d8f7cd88526f2c Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

ErikEJ commented 4 years ago

Is your project an SDK project?

wout-de-jong commented 4 years ago

I don't think so. I started VS and used the Solution Explorer to browse a folder with 2 .edmx files. 1 is an SAP OData v2 service, and the other a Dynamics $metadata file of 22 MB (!).

ErikEJ commented 4 years ago

Please share the first lines of your csproj file

wout-de-jong commented 4 years ago

Erik, I don't have a csproj file. Probably the EF6 Power Tools serve a totally different purpose than my requirement to visualize / view .edmx files. Right?

ErikEJ commented 4 years ago

No, they can do that, but need compiled code in a project in order to do it.

wout-de-jong commented 4 years ago

Not sure if I understand this prerequisite. So a "hello world" cs compilation will suffice?

ErikEJ commented 4 years ago

No, it must include the code generated from the EDMX file

wout-de-jong commented 4 years ago

OK, so it requires a c# project. I managed this by selecting New->Create Project From Existing Code... This might be obvious, but not to me.

Anyway, I see a ..Designer.cs file. I select the .edmx and press Generate Views. I see 3 errors, see below. Can you help out?


1>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Data.Entity.targets(86,5): error : Could not find the Conceptual Schema node to embed as a resource for input file '....edmx'.
1>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Data.Entity.targets(86,5): error : Could not find the Storage Schema node to embed as a resource for input file '....edmx'.
1>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Data.Entity.targets(86,5): error : Could not find the Mapping node to embed as a resource for input file '....edmx'.
ErikEJ commented 4 years ago

No, suggest you ask on Stackoverflow

wout-de-jong commented 4 years ago

Thanks for the quick replies, Erik.