Can Entity Framework Reverse Engineer Code First be used with MySql? - mysql

I'm working with MS Visual Studio 2012 Update 1 on Win 7 Ultimate SP1 and EF Power Tools.
I am trying to use the Reverse Engineer Code First functionality of entity framework on a MySql DB. I can successfully connect to the DB, but when it tries to complete the code gen I get the following errors:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DbContextPackage.Extensions.ProjectExtensions.InstallPackage(Project project, String packageId)
at Microsoft.DbContextPackage.Handlers.ReverseEngineerCodeFirstHandler.ReverseEngineerCodeFirst(Project project)
One or more errors occurred while processing template 'Entity.tt'.
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF.Utility.CS.ttinclude(1,4) : error : A processor named 'T4VSHost' could not be found for the directive named 'CleanupBehavior'. The transformation will not be run. The following Exception was thrown:
System.InvalidOperationException: Cannot find processor for directive 'T4VSHost'.
at Microsoft.DbContextPackage.Utilities.EfTextTemplateHost.Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost.ResolveDirectiveProcessor(String processorName)
at Microsoft.VisualStudio.TextTemplating.Engine.ProcessCustomDirectives(ITextTemplatingEngineHost host, TemplateProcessingSession session, IEnumerable`1 directivesToBeProcessed)
I have been unable to find any information using my google foo.

This is currently an Active bug with entity framework. The bug details can be seen here.
There are currently 2 work-arounds and the one that I used is below.
Open the File for C#:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF.Utility.CS.ttinclude
or for VB.net:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF.Utility.VB.ttinclude
And Remove the First Line:
<## CleanupBehavior Processor="T4VSHost" CleanupAfterProcessingTemplate="true" #>

Related

Advice needed: NewtonSoft.Json and Dynamics NAV 2009 R2 Classic

I'm trying to get the Codeunit 50000 in this zip file to work: https://kappiwebhosting.blob.core.windows.net/dynamcisis/2015/09/Json.zip
Found here: https://dynamics.is/?p=2303
C/AL Globals
I'm trying to get Dynamics Nav 2009 to recognize the NewtonSoft.Json.dll, but no matter which version i try, i get this error as soon i want to verify the DotNet variable "JsonTextReader"/"JsonTextWriter" when selecting the subtype.
.NET interop: exception occured, 'Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.'.
If i declare a new Test variable of type DonNet and click [...] to select it from scratch i got this error when trying to choose which assembly to use:
.NET interop: exception occured, 'Could not load file or assembly 'C:\Program Files (x86)\Microsoft Dynamics NAV\60\Classic\Add-ins\Newtonsoft.Json.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.'.
The Newtonsoft.Json.dll file is present ind the folder, and "Everyone" have full control to the folder as well as the file.
The Json.zip file contain a single Newtonsoft.Json.dll which i started out with. Same error. The i downloaded the https://github.com/JamesNK/Newtonsoft.Json/releases and tried all versions with the same result.
Why all this? Yes, the company i work for have decided to start using Shopify, and i need to write an interface for getting orders from Shopify etc.
I really cannot figure out why i can't get this to work. There are 3 other DotNet "variables" that's configured and works as intended with no errors.
So any advice is highly appreciated.
Thanx

Cannot Add Script Component to Data Flow Task

Cannot add a Script Component to Data Flow Task for an SSIS Package that I am working on.
I am running Visual Studio 2017 and creating an SSIS Package that is targeted for SQL Server 2012
I am trying to drag the Script Component Task from the SSIS Toolbox to the Data Flow Task, I get the error as shown below
TITLE: Microsoft Visual Studio
The component could not be added to the Data Flow task. Could not
initialize the component. There is a potential problem in the
ProvideComponentProperties method.
ADDITIONAL INFORMATION:
Error at Replace Delimiter in File [SSIS.Pipeline]: Failed to create
COM Component Categories Manager due to error 0x80070002 "The system
cannot find the file specified.".
Error at Replace Delimiter in File [ [52]]: The component is missing,
not registered, not upgradeable, or missing required interfaces. The
contact information for this component is "".
Exception from HRESULT: 0xC0048021
(Microsoft.SqlServer.DTSPipelineWrap)
BUTTONS:
OK
The Script Component should be added to the Data Flow Task
Thanks for your suggestions - but I ended up upgrading my license to visual studio 2019 and it worked like a charm
I guess because with this version the SSDT is integrated better
Not really entirely sure what the issue was with Visual Studio 2017 - it could be my install but because VS 2019 didn't work I did not bother with it.

Reference .netstandard 2.0 project in core 2.0 Runtime loading error when GenerateAssemblyInfo = false

When we add the reference, we are able to use the .netstandard libs classes in our .net core console project (in Visual Studio), and it compiles.
When we run the app, it immediately crashes with this error in the output window:
An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in Unknown Module. Could not load file or assembly
'MyNetStandard20Assembly, Version=0.1.0.0, Culture=en-us,
PublicKeyToken=null'. The system cannot find the file specified.
Update / Cause (still looking for reason)
So we use AssemblyInfo files in our projects and in order to make these work with the new project structure we needed to add this to the first PropertyGroup in the .NET Standard project:
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
That then allows us to have a Properties/AssemblyInfo.cs file in the project, just like a .NET Framework project would allow.
Anyway, when we remove this from the .NET Standard project then the .NET Core project finds the assembly and is happy.
Does anyone know why?

mySQL Data Provider .NET Core 2.0

Looking for help for some solutions on switching out the default data provider for the project from MS SQL to mySQL. Eventually with the intent of deploying the solution to Auruora on AWS.
After installing the nuget package I get something along the lines of :
System.TypeLoadException: Method 'Clone' in type 'MySql.Data.EntityFrameworkCore.Infraestructure.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=6.10.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.
This lead me to believe that there is no .NET 2.0 Entity Framework Core extention that runs for MySQL. Do I have to rollback to a different version?
For EntityFrameworkCore, it's suggested to use Pomelo.EntityFrameworkCore.MySql.
You may refer to their Getting Started documentation.
A fellow member of the community has kindly summarised the essential steps here:
Put Pomelo.EntityFrameworkCore.MySql into the xxx.EntityFrameworkCore project's .csproj file (see step 2 in the Pomelo getting started guide)
In your xxxDbContextConfigurer class put builder.UseMySql(...) rather than builder.UseSqlServer(...)
Change the connection string found in the appsettings.json file in the xxx.Web.Host project

Mercurial side-by-side configuration is incorrect

I'm trying to install and run x64 Mercurial 3.8.3, but I'm getting the following error:
D:\Program Files\Mercurial>hg.exe
The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
Running sxstrace.exe gives the following log:
=================
Begin Activation Context Generation.
Input Parameter:
Flags = 0
ProcessorArchitecture = AMD64
CultureFallBacks = en-US;en
ManifestPath = D:\Program Files\Mercurial\hg.exe
AssemblyDirectory = D:\Program Files\Mercurial\
Application Config File =
-----------------
INFO: Parsing Manifest File D:\Program Files\Mercurial\hg.exe.
INFO: Manifest Definition Identity is (null).
INFO: Reference: Microsoft.VC90.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
INFO: Resolving reference Microsoft.VC90.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
INFO: Resolving reference for ProcessorArchitecture amd64.
INFO: Resolving reference for culture Neutral.
INFO: Applying Binding Policy.
INFO: Find publisher policy at C:\WINDOWS\WinSxS\manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9177_none_acd40623e1d81331.manifest
INFO: Begin assembly probing.
INFO: End assembly probing.
ERROR: Activation Context generation failed.
End Activation Context Generation.
It seems like it's looking for C:\WINDOWS\WinSxS\manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9177_none_acd40623e1d81331.manifest, which doesn't exist on my computer. I think this file comes from the Microsoft Visual C++ 2008 Redistributable Package (x64), but when I installed/repaired it I still get the same error.
I've also come across this same package from chocolatey, but its version history seems to indicate that its latest version is 9.0.30729.6161, not the 9.0.30729.9177 I'm looking for. I'm not sure where to find this version of the package.
I've already looked at these questions which seem very similar to my situation:
Side by Side configuration is incorrect error
Visual Studio 2012 Side by side configuration is incorrect
Edit: I've just reinstalled with x86 Mercurial and it works. Not ideal, but at least it's a workaround.
Microsoft Visual C++ 2008 Redistributable Package 9.0.30729.9177 doesn't seem to be publicly available, so I ended up reinstalling Windows. Now I can run Mercurial after installing it.