kdqfi.over-blog.com/
4 Décembre 2020
I've started playing with Visual Studio 2017 on the Mac, pulling across a sample MVC Core + Entity Framework Core tutorial project on the Microsoft site. The tutorial can be found here.
I run a Windows in a VirtualBox VM on the Mac, so I have a full Windows 10 + VS 2017 Community install with MSSQL 2016 on it.
On the Mac side, I was trying the latest VS 2017 Community for Mac, along with ASP.NET Core.
I was hoping to suss out how much cross-platform compatibility there was, and how much of a poor cousin VSMac was compared to its Windows counterpart, which is still one of my favourite IDEs.

Installing VSMac is pretty straightforward and .NET Core is a separate install documented on the Microsoft website.
Extension for Visual Studio - The WiFi Framework is the Software Developer Kit (SDK) for software developers that provides an easy access to the WiFi features on the Windows desktop platforms. WiFi Framework.NET Edition - Visual Studio Marketplace.
Framework targeting includes the following features: When you open a project that targets an earlier framework version, Visual Studio can automatically upgrade the project or leave the target as-is. When you create a.NET Framework project, you can specify the version of the.NET Framework that you want to target. Visual Studio for Mac.NET. Azure DevOps Server (TFS) 1. Cannot create new ASP.NET Web Application (.NET Framework) windows 6.1 visual studio 2017 version 15.7 project. VinteJ10 reported Jul 11, 2018 at 08:06 AM. Show comments 4. Extension for Visual Studio - The WiFi Framework is the Software Developer Kit (SDK) for software developers that provides an easy access to the WiFi features on the Windows desktop platforms. WiFi Framework.NET Edition - Visual Studio Marketplace. The runtime includes everything you need to run existing apps/programs built with.NET Framework. Download.NET Framework 4.6.2 Runtime. The developer pack is used by software developers to create applications that run on.NET Framework, typically using Visual Studio. Download.NET Framework 4.6.2 Developer Pack.
I started and finished the project on the Windows VM, running on MS Sql Server. This project opens up fine on VSMac. I had some high expectations it would, and it does. It even builds and runs!
Of course, the lack of database access on the Mac side needed to be addressed, but the web project hosted inside VSMac started up and ran just fine in Safari using localhost and a custom port number just as in the Windows VM and Edge.
Converting to use MySQL instead of SQL Server would be the next challenge.
I didn't find too many options for MySQL. There are some hints on the MySQL blog that MySQL Connector works with Core, but I couldn't actually find a package for the Mac listed in their downloads so I gave up. The one that looked OK is Pomelo.
Pleasantly enough, Pomelo.EntityFrameworkCore.MySql is one of the packages listed when firing up the Project | Add NuGet Packages… option in VSMac.
Simply add the package to your project at this point and you're almost ready to go.
This was also fairly straightforward. In the Startup.cs file, the database context needs to be adjusted to use MySQL.
From:
To:
The connection string in the appsettings.json was also changed to the MySQL flavour:
Once this was done, running

dotnet ef update
on the terminal command line in the project directory (where the .csproj file is located) should attach to the configured MySQL instance and create the required tables (in this case, just one) for the sample project.
And voila – things run and the database is created. Quite impressive. You can even add a new movie. But alas, not a second movie…because…
For some reason, the Pomelo provider, or .NET, or something somewhere doesn't know that EF relies on the ID field on the table being an auto incrementing field. This causes any table inserts beyond the first item to fail with a MySqlException: Duplicate entry ‘0' for key ‘PRIMARY'error.
Wd my passport mac 1tb portable external hard drive. The fix is simple enough; either:
More research to come, but the next step will be configuring the project so it runs nicely under NGINX or Apache as a Kestrel reverse proxy on the Mac without Visual Studio hosting.