Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Challenges in using update-database to create initial data #1825


User avatar
0
gregarmstrong created

Hi there,

We have got the code setup from ABP for new applicaiton and changed the connection string to point to development database server.

On first application run, it created all the require tables. However it did not setup the default tenant in the applicaiton. Due to this, I'm getting error for default language not available.

So tried to run the update-database so the Seed method will create initial data. but could not able to run it.

Initially, it specifiy that EntityFramework was not available in the EntityFramework project. Error - The EntityFramework package is not installed on project 'Progressive_care.EntityFramework'.

After adding the EntityFramework Nuget package for this project, getting new error as follow: Error - Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation, Version=14.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable." At C:\Users\laxman.g.nuget\packages\EntityFramework\6.1.3\tools\EntityFramework.psm1:718 char:5

  • $domain.SetData('project', $project)
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : SerializationException

Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation, Version=14.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable." At C:\Users\laxman.g.nuget\packages\EntityFramework\6.1.3\tools\EntityFramework.psm1:719 char:5

  • $domain.SetData('contextProject', $contextProject)
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : SerializationException

Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation, Version=14.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable." At C:\Users\laxman.g.nuget\packages\EntityFramework\6.1.3\tools\EntityFramework.psm1:720 char:5

  • $domain.SetData('startUpProject', $startUpProject)
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : SerializationException

System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue[T](Project project, String propertyName) at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory) at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0() at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command) Object reference not set to an instance of an object.

Any help in this regard is appreciated.

Thanks, Greg


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    This is a duplicate of #1826. Let's continue there.