I have two projects in my UWP solution : one is Blank App (Universal Windows) another is a Class Library (Universal Windows). I installed Microsoft.EntityFrameworkCore.SQLite 鈥揚re and Microsoft.EntityFrameworkCore.Tools 鈥揚re in the Class library project. When I tried to add the initial migration file with : Add-Migration MyFirstMigration, it throws a red coloured exception :
Add-Migration : Value does not fall within the expected range.
At line:1 char:1
- Add-Migration MyFirstMigration
~~~~~~
- CategoryInfo : OperationStopped: (:) [Add-Migration], ArgumentException
- FullyQualifiedErrorId : System.ArgumentException,Add-Migration
I was following this article.
Can you share the output you see when execute Add-Migration MyFirstMigration -Verbose?
Also, there are currently known issues with using a UWP class library vs UWP application project. See https://github.com/aspnet/Microsoft.Data.Sqlite/issues/245 and https://github.com/aspnet/EntityFramework/issues/5069#issuecomment-216654757
Can you add "-Verbose"?
Thanks. Possible duplicate of https://github.com/aspnet/EntityFramework/issues/5293. This needs investigation.
OK, that will be nice :+1:
just for a reminder : I am using EntityFrameworkCore.SQLite 鈥揚re and EntityFrameworkCore.Tools 鈥揚re
I think the Toolsi have beenrenamed!?
just for a reminder : I am using EntityFrameworkCore.SQLite 鈥揚re and EntityFrameworkCore.Tools 鈥揚re
Are those the package names, or do you have Microsoft.EntityFrameworkCore.SQLite etc.
Hey, Wondering why this issue is closed. It appears that all tickets are referenced back to each other saying "duplicate".
I am stuck, after the migration to RC2 with the same error. Planned my UWP app publishing this weekend. It would be great if someone can help me with a workaround to resolve this issue.
@abdu292 this issue is not closed.
Okay. Thank you @divega . Being new to Github web pages, I miss understood something may be. Also I reverted back my changes to RC1 for now from my TFS changeset. Hope to see some one giving a workaround to use RC2 (since RC1 doesn't work with consecutive migrations, we always need to delete & recreate the db).
Yes, I have Microsoft.EntityFrameworkCore.SQLite and Microsoft.EntityFrameworkCore.EntityFrameworkCore.Tools
Friends, Wondering on the status. I had to put my app publishing on hold as it doesn't pass WACK due to #5069. However the work around for that is to use RC2, which is not possible at the moment because of this issue (#5383) as my EF is on a Class Library.
@natemcmaster @rowanmiller Any help with other workarounds would be much appreciated.
@abdu292 Move EF to the App!?
Thank you @ErikEJ .
I have dedicated Data, Business and Shared libraries. Moving the Data/EF on to the App will cause a Circular dependency. Moving Business also on to app will be a lot of work for me, I have a lot of test cases for the Business Library too and the layers/libraries are inter dependent.
Are we expecting a delay in the resolution of this issue?
Thanks!
I faced another exception after upgrade to RC2.
My dependencies configuration is now:
{
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"Microsoft.EntityFrameworkCore.SQLite": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview1-final",
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0"
},
}
and I got MissingMethodException:
Add-Migration initial
System.MissingMethodException: Method not found: 'Void Microsoft.Extensions.Logging.LoggerExtensions.LogVerbose(Microsoft.Extensions.Logging.ILogger, System.String)'.
at Microsoft.Data.Entity.Design.DbContextOperations.CreateContext(String contextType)
at Microsoft.Data.Entity.Design.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
at Microsoft.Data.Entity.Design.OperationExecutor.<AddMigrationImpl>d__7.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at Microsoft.Data.Entity.Design.OperationExecutor.OperationBase.<>c__DisplayClass4_01.<Execute>b__0()
at Microsoft.Data.Entity.Design.OperationExecutor.OperationBase.Execute(Action action)
Method not found: 'Void Microsoft.Extensions.Logging.LoggerExtensions.LogVerbose(Microsoft.Extensions.Logging.ILogger, System.String)'.
Finally I thought to spend sometime to put everything on to the App, to see if that resolves the issue. However here is what I get when I do the migration. Any input would be much appreciated.
(I am using Visual Studio "15")
PM> Add-Migration Initial
Add-Migration : Exception calling "CreateDomain" with "3" argument(s): "The domain manager specified by the host could not be instantiated."
At line:1 char:1
@yeasin90 confirmed this is a bug in RC2. Adding a fix here in #5476.
@abdu292 and @ahanoff the errors you posted in comments seem to be unrelated to the original issue this bug was opened to track. Can you please create separate issues and include a minimal repro of the issue you encountered?
Thank you @natemcmaster . It looks like the issue I mentioned was only with Visual Studio "15" and not happening with Visual Studio 2015. So we are good (at least now). Thanks!
@natemcmaster Sure! I will create separate task with detailed description. Thanks.
I'm pretty new in this whole git flow. Just wondering, as a fix is applied on to this issue, when I get this. Should I wait for the next release? or clone this entire repository and use in project? Is there any way to get only the dlls with this fix? Thanks!
@abdu292 : I believe we will get an Update in NuGet :)
@abdu292 our nightlies will contain the fix soon. Checkout https://github.com/aspnet/Home/wiki/NuGet-feeds for an explanation of those feeds. Or, you can wait for the next release which will be end of June. See https://github.com/aspnet/EntityFramework/wiki/Roadmap
@natemcmaster : Now migration files are creating for separate UWP class libraries :) :), I did a package restore. I guess, db.Database.Migrate() is not available :(
Thank you @yeasin90 for the response.
@natemcmaster Thank you for sending me the link on myget. I tried configuring my Visual Studio with "http://myget/aspnetvolatiledev" and "https://myget.org/aspnetvolatiledev" however no luck so far. The remote name could not be resolved: 'myget'.
Can you help me with the correct url? Thanks!
Please ignore (as you already did) my previous comment. Following this Workaround
,the migration was successful even within the class library and WACK was passed.
Not sure, why nobody has notified me this on my original question, until @divega responded to @MMalikKhan here
Anyway Thank you all!
Hi,
Just to know whether this fixed is available in nuget? otherwise thinking about a work around like executing some sqlite db script inside OnModelCreating for any column add/change :)
@yeasin90 the fix for this bug (#5476) was added for our 1.0.0 release which will be available on nuget next week.
@natemcmaster : wow :) thank you very much for the response. Looking forward to 27th June
Most helpful comment
Friends, Wondering on the status. I had to put my app publishing on hold as it doesn't pass WACK due to #5069. However the work around for that is to use RC2, which is not possible at the moment because of this issue (#5383) as my EF is on a Class Library.
@natemcmaster @rowanmiller Any help with other workarounds would be much appreciated.