I'm making a model-first database and I'm trying to generate my MySql schema. When I click on "Generate Database from Model" it gives me this error
Encountered the following errors while processing the template 'E:\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\SSDLToMySQL.tt:
Line 141, Column 0: 'Running transformation: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.TextTemplatingE384461094E1DFC8313DC1AA4CE547BEB91411CCECC4E940B2CAA4A167C5F68F403F4103FA7B7E1BB1B4B97B86595FBABCAF62EA3385ABAA9AF47E060E49D857.GeneratedTextTransformation.GetProviderManifestToken(String edmxPath) in e:\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\GenerateMySQL.Utility.ttinclude:line 142
at Microsoft.VisualStudio.TextTemplatingE384461094E1DFC8313DC1AA4CE547BEB91411CCECC4E940B2CAA4A167C5F68F403F4103FA7B7E1BB1B4B97B86595FBABCAF62EA3385ABAA9AF47E060E49D857.GeneratedTextTransformation.TransformText() in e:\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\SSDLToMySQL.tt:line 121'
I went and checked the references files and I'm not sure what I should do. Here are the files content at the targetted lines.
GenerateMySQL.Utility.ttinclude
(142 -->) foreach (var node in xmlDocument.SelectSingleNode("/edmx:Edmx/edmx:Runtime/edmx:StorageModels", namespaceMgr).ChildNodes)
{
if (((XmlNode)node).Name.Equals("Schema") && ((XmlNode)node).Attributes.GetNamedItem("ProviderManifestToken") != null)
{
return ((XmlNode)node).Attributes["ProviderManifestToken"].Value;
}
}
return String.Empty;
SSDLToMySQL.tt
EnvDTE.DTE env = (EnvDTE.DTE)((IServiceProvider)this.Host).GetService(typeof(EnvDTE.DTE));
(121 -->)string serverVersion = GetProviderManifestToken(edmxPath);
string connection = String.Empty;
I know it used to work before but now it just gives me this error. It is an extremely simple schema, 3 tables with Strings and Int32's, some relationships. The project is otherwise empty and no modifications have been done other than the initial setup of the Mysql connection.
I have MySql Connector version 6.7.4 and Entity Framewiork v6.0.1 on Visual Studio 2012.