I’ve developed WhatsApp Viewer with the good old Visual Studio 2008.It’s a bit dated and doesn’t support all of the new C++ features.
That’s why I create PowerShell script running commands inside Visual Studio. To create migration you must have your solution with the database project opened. The running script will add a migration file to your solution (do not mess around in the editor while the script is running). Examples: PM.AddMigration.ps1 –n MigrationName.
- Add an EF6 Migration task. Once that task is added to an environment within the release, you'll need to enter the appropriate parameters to configure it. All file path parameters should be within the file system for the build, none of them are for TFS source control paths. See Getting Started With Entity Framework 6 and Entity Framework Tutorial.
- Oct 28, 2020 If you're more comfortable working inside Visual Studio or have experience with EF6 migrations, you can also use the Package Manager Console tools. Create your first migration You're now ready to add your first migration! Instruct EF Core to create a migration named InitialCreate.
Since the new Visual Studio 2017 is free (no costs) for personal usage and open-source projects, I thought it might be worth a shot.
My main development machine runs Linux Mint, and I prefer it over Windows a lot.Even though I use dual-boot (for games), I develop WhatsApp Viewer on Linux using a virtual machine running Windows XP.
Visual Studio 2017 doesn’t support XP anymore, so I had to set up a new virtual box and decided to go with Windows 7 then.
The VS2017 installer first complained about a missing update (KB4019990) and about the missing .NET 4.5 framework (I’ve installed 4.7.1 instead). This was easy to fix.Next, I’ve selected all options I wanted to install and let the setup do it’s job. This took some time, as it downloaded roughly 20 GB. The conversion of the old project files went well.
After the installation was successful, I’ve tried to build WhatsApp Viewer. I missed to install the “MFC and ATL Support” option, which led to this error message, complaining about afxres.h not found.
Next, I was able to build the project, but encountered a runtime error “Windows Imaging Component couldn’t be initialized”. This could be fixed by changing the “Platform toolset” to “Visual Studio 2017 - Windows XP (v141_xp)”. See this link for detailed information.
Now the compiled program worked.However, when I tried to debug it, some windows showed “The content requires a new version of Internet Explorer”. After I’ve downloaded the newest IE 11 this was fixed.
I’ve additionally added Clang and exported the virtual machine as an .ova image for future usage.The only disadvantage is the size: The new image takes ~40 GB on my hard-drive, compared to the 12 GB of Visual Studio 2008 (compressed as .ova its 19 GB vs 6 GB).
Too see if something major changed, I did a quick analysis on the resulting .exe files.Therefore I exported the file headers of both .exe using pev.
No new runtime dependencies (.dll) are required. Some imports now use the Unicode version instead of Ansi.Beside that, I couldn’t find major differences.I am quite happy with the result. I expect similar performance and can now use better tools and the new and improved C++ language features.
This article is rather small, but its target is to remind me how to enable migrations of database in Visual Studio.
Thus, the steps are:
- Press Ctrl + Q to go to the quick launch.
- In the quick launch write “Package Manager Console” and press enter.
- Make sure that you have selected the correct Default project in the console.
- In the console write> Enable-Migrations -EnableAutomaticMigrations and press enter.
- In the solution explorer, you get a folder migrations, in which a file Configuration.cs is present.
- If you open it, you may configure it this way (just an example, do not ever do AutomaticMigrationDataLossAllowed = true in production):
And that is it!