Upgrade from EF Core 1.1 to 2.0 preview - entity-framework-core

After upgrading EF1.1 to EF2.0 now I'm not able to do migrations.
Error: Startup project 'QilinSystem.Store.Data.csproj' targets
framework '.NETStandard'. This framework is not intended for execution
and may fail to resolve runtime dependencies. If so, specify a
different project using the --s tartup-project option and try again.
How to solve this issue?

EF Core 2.0 Preview 1 requires Visual Studio 15.3 Preview, so you have to install it.
Announcing EF Core 2.0 Preview 1:
Accessing .NET Core tooling in Visual Studio requires Visual Studio
2017 15.3 Preview, Visual Studio for Mac or Visual Studio Code. More
information about this and download links can be found in the .NET
Core 2.0 Preview 1 announcement.
Visual Studio Preview FAQ:
Preview installs next to your stable Visual Studio IDE, allowing you
to use either independently.

Related

Visual Studio 2012 with .NET 4 Framewrk install Entity Framework 6 tools for Visual Studio 2012

As mentioned in the title I need to modify a very old project. It uses .NET 4 Framework and connects to a local SQLite database. I used Visual Studio 2012 to avoid compatibility problems.
I cannot open the .EDMX file - I get this error:
Error 10027: The XML namespace for the conceptual model's Schema element is not supported on this project's target framework version.
I tried to install Entity Framework 6 because I read that should resolve the problem, but I'm not able to find it anywhere.
How can I fix this problem?

Problems with save operation in Visual Studio VSIX custom editor and .Net 6.0 Web application projects

We have built a Visual Studio Extension (VSIX). It is a custom editor for editing a special file that contains definitions for the datamodel in our CMS.
We are porting our CMS to .Net 6.0 from .Net 4.8 ( framework -> core ), however we are struggling getting the editor to work in .Net 6.0 projects. It works fine in web applications written in .Net 4.8, but not in .Net 6.0 web application projects.
Whenever we click the save button in Visual Studio, we get a very general and non specific error message that says: "The operation could not be completed. Unspecified error"
We run the extension with source code in debug mode using the Visual Studio SDK, and there is no exception that is picked up by Visual Studio. ( We use one Visual Studio instance to start another instance of Visual Studio in debug mode, as normal with VSIX projects). Breakpoints etc. work, and we have activated all exceptions in the debugger. When we click save in Visual Studio projects, we get the error message before any method is called in our code. We do not even enter the "IVsPersistDocData2.SaveDocData" method of the "WindowPane" class. The plugin is written in C#. Apart from save, everything works fine. The editor loads fine and function as normal in both types of projects.
There must be some difference in the way the extension integrates with Visual Studio that differ between .Net4.8 projects and .Net6.0 projects. Of course, there are differences in file paths etc in these projects, but I do not see how this is the root of the problem as we do not even get to the stage where any method is called in our editor source code.
As a test I created a very simple extension with only the bare minimum to enable a WindowPane extension, and I get the same error message when saving in 6.0 projects
We created the first version of the plugin back in 2013, using templates from Microsoft and have been updating it for every new version of Visual Studio. There have been some changes in the documentation and projects templates for VSIX, but unfortunately, there is no longer any C# template for custom editors, only C++. (https://learn.microsoft.com/en-us/visualstudio/extensibility/walkthrough-creating-a-custom-editor?view=vs-2022) Pherhaps someone knows any workings examples of custom editors written in c#?
So, we are a little stuck, the error message does not give us any clue to what is wrong. I have not found any documentation that could explain differences in Net 4.8 and Net 6.0 web projects that could cause this.
Anyone had a similar problem? Or perhaps a clue to what is causing this.
(BTW, we are using the latest version of Visual Studio 2022 Community and Windows 11)
After opening a support incident with Microsoft, further investigation and live debugging pointed to problems with VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.SaveItem and a possible internal bug in Visual Studio.
A temporary workaround suggested by Microsoft support, was to add the definition of IPersistFileFormat to the WindowPane implementation. ( None of the methods needed to be implemented. )
This solved the problem for us. The definition of our working WindowPane is now:
public sealed class OntologyDesignerEditorPane : WindowPane, IVsPersistDocData2, IPersistFileFormat, IVsFileChangeEvents

Entity Framework Power Tools does not appear in VS 2012

I have installed EntityFramework 6.01 and have added a reference to my project. I closed Visual Studio 2012 and I then installed EF Power Tools Beta 4.
I re-opened Visual Studio 2012 and right-clicked my project containing dbContext. No entry appears in the context menu for Entity Framework. No error messages occurred during installation.
Are there additional pre-requisites to using EF Power Tools?
I think I have discovered the solution. My company uses VB.net as the standard development language. As a test, I started a C# project. Entity Framework Power Tools are fully present in the C# project. It appears that Entity Framework Power Tools are not yet available in VB.net projects.
Try right clicking on the project. I just looked at the beta 4 description and it does not reference EF 6. But the reverse engineer classes from database should show up with a right click on the project, indicating that at least the power tools installed correctly. These are the only comparability issues I could find:
Generate Views won’t work with prerelease versions of EF6.
It will, however, work with the RTM version when it’s released.
View Entity Data Model won’t work with EF6 on Visual Studio 2010.
Beta 4 updates the Power Tools to work with Entity Framework 6 and Visual Studio 2013. The following issues have also been fixed in this release.
Power Tools don't work when project is under a solution folder
Power Tools stop working when EF.dll is loaded into VS
Specific info found on the ado.net blog on msdn

Visual Studio 2012 Express with Entity Framework menu

I installed VS 2012 beta version and then installed Entity framework following this tutorial and it worked fine.
VS 2012 beta expired so i got VS 2012 Express. I tried to follow the same tutorial but now i don't have "Entity Framework Reverse Engineer Code First" in right-click project menu.
Is it a limitation in Visual Studio 2012 Express?
EF Power Tools are not available on Express SKU - you need at least Pro version. See this thread for more detailed answer: How to install EFPowerTool Beta on the right version of VS on my PC

EF Power Tools Beta 2 and Visual Studio 2012 RC

The ADO.NET blog at
http://blogs.msdn.com/b/adonet/archive/2012/04/09/ef-power-tools-beta-2-available.aspx
says:
Compatibility
The Power Tools are compatible with Visual Studio 2010 and Entity Framework 4.2 or later.
You can also install the Power Tools on Visual Studio 11 Beta, but you may receive the error "A constructible type deriving from DbContext could not be found in the selected file." This is caused by a bug in the Visual Studio 11 unit test tools where an older version of EntityFramework.dll is being loaded. We are working closely with that team to resolve the issue. As a workaround, you can delete the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\BindingPaths{BFC24BF4-B994-4757-BCDC-1D5D2768BF29} registry key. Be aware, however, that this will cause the Unit Test commands to stop working. Thank you, early adopters, for your superhuman patience with prerelease software.
My question is:
Does anybody know if this issue is resolved on VS2012 Professional RC? I have a pretty stable installation and don't want to mess up with it.
Yes, it is fixed in Visual Studio 2012 RC.