When executing enable-migrations, an exception occurred when calling "SetData" using the 2 parameter: "Assembly" Microsoft.VisualStudio.TeamArchitect.ModelingProject,.. "

Source: Internet
Author: User

Open the MVC Project today (Code-first) and plan to update the database manually, so do this directly in the Package management console:

Enable-migrations-contexttypename bjylonlineserv.areas.enterprise.dal.enterprisecontext-migrationsdirectory Migrations\enterprise;

Console directly gave me a mistake like this, I am surprised, before the good ah, what happened. Error:

Pm> Enable-migrations-contexttypename BJYLOnlineServ.Areas.Enterprise.DAL.EnterpriseContext-migrationsdirectory migrations\enterprise use " 2 "parameter called" SetData ":" Assembly " Microsoft.VisualStudio.TeamArchitect.ModelingProject, version=12.0.0.0, Culture=neutral, publickeytoken= b03f5f7f11d50a3a "type" Microsoft.VisualStudio.TeamArchitect.ModelingProject.ModelProjectAutomationObject " is not marked as serializable. "Location D:\DOCUEMTN-XF\03WORK\ONLINESERVICE_CURR\TRUNK\PACKAGES\ENTITYFRAMEWORK.6.1.3\TOOLS\ENTITYFRAMEWORK.PSM1 : 720 character (s): 20+ $domain. SetData <<<< (' Startupproject ', $startUpProject) + categoryinfo:notspecified: (:) [], methodinvocationexception +  fullyqualifiederrorid:dotnetmethodexception System.NullReferenceException: Object reference not set to an instance of an object. In System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes (Project project, Int32 Shellversion) in System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebProject (Project Project) in System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade (String configurationtypename, Boolean Usecontextworkingdirectory) in System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable (String ContextTypeName) in System.Data.Entity.Migrations.EnableMigrationsCommand.<>c__DisplayClass2.<.ctor>b__0 () does not set an object reference to an instance of an object in System.Data.Entity.Migrations.MigrationsDomainCommand.Execute (Action command). 


So ah, I find the reason ah, I find AH find, and really found.

Original: Because I previously set up another project for the startup project, rather than the command in the Bjylonlineserv this project, so I reported this error ... Flow Han Ah ... , we must pay attention to it later!

So write down, to facilitate their own inspection, but also to those who may encounter this problem, to provide a solution, hehe!

When executing enable-migrations, an exception occurred when calling "SetData" using the 2 parameter: "Assembly" Microsoft.VisualStudio.TeamArchitect.ModelingProject,.. "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.