This is the discussion issue for this announcement: https://github.com/aspnet/Announcements/issues/274
Updating my package references causes 1000's of errors with:
Severity Code Description Project File Line Suppression State
Error CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. EntityFramework.SqlServerCompact35, EntityFramework.SqlServerCompact40 C:\Code\EntityFramework.SqlServerCompact\src\Provider40\Infrastructure\Internal\SqlCeOptionsExtensions.cs 8 Active
My project is a .NET 4.6.1 class library, using old school csproj and packages.config.
I am using VS 2017 15.3.2
Project: https://github.com/ErikEJ/EntityFramework.SqlServerCompact
I have a smallish test .NET Core Console project with SQLite (on mac in vscode) and that updated with no issues. not seeing the problems that ErikEJ is having though big difference in what we're testing (.NET 4.6.1 vs .NET Core).
Also, I forgot that the "fix" to updating value objects (owned entities) was just a clearer error message.
@bricelam Can you please investigate with @ErikEJ what he is seeing?
@ErikEJ I'm not able to repro this locally. Do you have a branch including the changes after you update the packages?
(I'm using VS 15.4.1)
I'm receiving this error when trying to use these updated packages:
/home/kjbetz/Source/Repos/kjbetz/ami/src/AmiMedia/AmiMedia.csproj : error NU1102: Unable to find package Microsoft.NETCore.App with version (>= 2.0.2-servicing-25728-02)
/home/kjbetz/Source/Repos/kjbetz/ami/src/AmiMedia/AmiMedia.csproj : error NU1102: - Found 16 version(s) in nuget.org [ Nearest version: 2.0.0 ]
/home/kjbetz/Source/Repos/kjbetz/ami/src/AmiMedia/AmiMedia.csproj : error NU1102: - Found 0 version(s) in patch pre-release feed
Restore failed in 5.73 sec for /home/kjbetz/Source/Repos/kjbetz/ami/src/AmiMedia/AmiMedia.csproj.
Here is my .csproj
:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Label="Build">
<NoWarn>$(NOWARN);NU1605</NoWarn>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>AmiMedia</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>AmiMedia</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);dnxcore50;netcore50;portable-net45+win8</AssetTargetFallback>
</PropertyGroup>
<ItemGroup>
<None Update="logs">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
<None Update="**.user;**.vspscc">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" PrivateAssets="All" Version="2.0.1-*" />
<PackageReference Include="AutoMapper" Version="6.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="3.0.1" />
<PackageReference Include="FluentValidation.AspNetCore" Version="7.1.1" />
<PackageReference Include="GenFu" Version="1.4.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.0.0" />
<PackageReference Include="MediatR" Version="3.0.1" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="3.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.0.0" />
<PackageReference Include="Serilog" Version="2.5.0" />
<PackageReference Include="Serilog.AspNetCore" Version="2.0.0" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.2" />
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Serilog.Settings.Configuration" Version="2.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Seq" Version="3.3.3" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1-*" />
</ItemGroup>
</Project>
Running on Linux, .NET Core. Any ideas?
@kjbetz I think we found that issue internally and we're working on an updated build with a fix for that. @natemcmaster can you confirm if that's the same issue as the one you fixed earlier today?
@Eilon This issue most likely comes from trying to reference Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.1-*. That's unrelated the scaffolding issue we fixed earlier today.
@ryanbrandenburg it looks like our feed doesn't have packages from our partner teams.
@kjbetz In the meantime, you can workaround by also adding this feed to your NuGet.config file:
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
The package you need is here: https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.NETCore.App/2.0.2-servicing-25728-02
@natemcmaster this test feed is just for ASP.NET/EF Core, specifically without any other packages. I do not recommend mixing feeds because that will introduce other unrelated packages.
Hello! For a positive feedback I updated my project and finally everything seems working fine, including high-priority bug fix for #9128.
Is it possible to access pre-release builds in the future publicly? I'm waiting for a pre-release package like this for more than 2 month now as #9128 was completely broke my app, so updating my app for .NET Standard 2.0 is pending since releasing it in August.
Thanks for your hard work.
@bricelam Apparently it was just Visual Studio having a bad day.
I am now able to upgrade and run all tests, however, two tests fail for me:
Test 'Microsoft.EntityFrameworkCore.Specification.Tests.GearsOfWarQuerySqlCeTest.Enum_ToString_is_client_eval' failed: Assert.Equal() Failure
↓ (pos 0)
Expected: Corporal
Actual: 1
↑ (pos 0)
at Microsoft.EntityFrameworkCore.Query.GearsOfWarQueryTestBase`2.Enum_ToString_is_client_eval()
Test 'Microsoft.EntityFrameworkCore.Query.ComplexNavigationsQuerySqlCeTest.Include_reference_collection_order_by_reference_navigation' failed:
Assert.Equal() Failure
Expected: 3
Actual: 11
at Microsoft.EntityFrameworkCore.Query.ComplexNavigationsQueryTestBase`2.ComplexNavigationsQueryResultAsserter.AssertLevel1(Level1 expected, Level1 actual, IEnumerable`1 expectedIncludes)
at Microsoft.EntityFrameworkCore.Query.ComplexNavigationsQueryTestBase`2.ComplexNavigationsQueryResultAsserter.AssertElement[TElement](TElement expected, TElement actual, IEnumerable`1 expectedIncludes)
at Microsoft.EntityFrameworkCore.TestUtilities.QueryResultAsserter.AssertCollection[TElement](IEnumerable`1 expected, IEnumerable`1 actual, IEnumerable`1 expectedIncludes)
at Microsoft.EntityFrameworkCore.Query.ComplexNavigationsQueryTestBase`2.ComplexNavigationsQueryResultAsserter.AssertCollection[TElement](IEnumerable`1 expected, IEnumerable`1 actual, IEnumerable`1 expectedIncludes)
UWP -- so far so good!
Trying the new EFCore with a UWP app that was already using EF Core 2.0. I wanted to test relational queries (as per https://github.com/aspnet/EntityFrameworkCore/issues/9355) which meant changing my model.
It compiles and runs and I can do a query with Include() in it successfully. I had not tried this with 2.0 so assuming that this was a reasonable way to test it.
I used my "all in one" project to do this and hit the issue of not being able to use migrations (because I changed my model). I also have a second version of my solution where I had split out data stuff into a separate project and I see that you have a note about adding that guidance into the docs. So I'll go forward with that version now.
On: Windows 10 Fall Creators Update 16299
VS2017 15.4.0 (oops better update again!)
package ref EFCore.Sqlite 2.0.1-* which pulled in 2.0.1-rtm-203
@nyiroe we'd like to get these patches out sooner next time - we ran into infrastructure issues that took a long time to resolve. We'd certainly like to push these to NuGet.org as well but we're trying out the process on MyGet.org first (it's a lot easier for us to manage).
@julielerman Yes, UWP tooling is far from ideal in EF Core 2.0. Things got a lot more difficult with .NET Standard 2.0. So difficult, in fact, that they even had to change how the XAML designer worked. We hope to follow suit soon.
@bricelam no complaints from me on people being forced think a little more about their application architecture and separation of concerns! :)
We are using DB First and after upgrading the solution to 2.0.3-* package the Database Scaffolding bug for varchar(max) and issues I had with nullable boolean properties getting generated with the 2.0.0 package went away.
Ship it!
For the record, Pomelo.EntityFrameworkCore.MySql will be needing new preview/prerelease version because of https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/418.
Which AFAIR is on the way with long awaited data result set buffering fix :-)
After
$ dotnet publish -c Release
$ cd bin\Release\netcoreapp2.0\publish
I'm seeing
Error:
An assembly specified in the application dependencies manifest (AspNetCore.ExistingDb.deps.json) was not found:
package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.1-rtm-203'
path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll'
This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
aspnetcore-store-2.0.3-rtm-203.xml
both on docker * (Linux) and Windows
Mentioned bin/Release/netcoreapp2.0/publish/AspNetCore.ExistingDb.deps.json
We haven't published a new runtime store that would include the new versions of Microsoft.AspNetCore.Antiforgery. You can workaround this in pre-release bits by disabling the runtime store.
dotnet publish -c Release -p:PublishWithAspNetCoreTargetManifest=false
I ended up just removing the tools for the time being and that fixed my first issue.
I ran into 'dotnet publish' issue too but remedy listed above by @natemcmaster fixed that for now too.
After update to this version "dotnet ef --startup-project ../WebApi migrations add {MigrationName}"
give this error:
[05:10:34 DBG] An 'IServiceProvider' was created for internal use by Entity Framework.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.EntityFrameworkCore.Metadata.Internal.InternalModelBuilder.RemoveEntityType(EntityType entityType, ConfigurationSource configurationSource)
at Microsoft.EntityFrameworkCore.Metadata.Internal.InternalModelBuilder.Ignore(EntityType entityType, ConfigurationSource configurationSource)
at Microsoft.EntityFrameworkCore.Metadata.Internal.InternalModelBuilder.RemoveEntityTypesUnreachableByNavigations(ConfigurationSource configurationSource)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ModelCleanupConvention.Apply(InternalModelBuilder modelBuilder)
at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ImmediateConventionScope.OnModelBuilt(InternalModelBuilder modelBuilder)
at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder, IModelValidator validator)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel()
at Microsoft.EntityFrameworkCore.Internal.DbContextServices.get_Model()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass22_0.<RealizeService>b__0(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(Func`1 factory)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(String contextType)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.ScriptMigration(String fromMigration, String toMigration, Boolean idempotent, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScriptMigration.<>c__DisplayClass0_1.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Object reference not set to an instance of an object.
@bricelam / @ajcvickers - any ideas on this error?
@Eilon this occurs when I have a value object in my entity and ignore it in the model builder with the builder.Ignore(x => x.ValueObject);
The error occured in all entity framework operations, not only in add migrations command, do u know any workaround for this ?
@tiagorosendo Can you please file a new issue for this, including a complete code listing or project that will allow us to reproduce what you are seeing? Also, was this working in 2.0.0 and broke when updating to 2.0.1/2.0.3?
I'm getting this warning at dotnet run on a project I just shifted from EF Core 2.0 to EF Core 2.0.1-*:
also: macOS Sierra (not High Sierra)
Visual Studio Code
I have used the tools in a few other projects that I tested out and did not see this warning before. the bright yellow text is hard to miss.
warning NU1603: Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.1-rtm-203 depends on Microsoft.NETCore.App (>= 2.0.2-servicing-25728-02) but Microsoft.NETCore.App 2.0.2-servicing-25728-02 was not found. An approximate best match of Microsoft.NETCore.App 2.1.0-dev-di-25408-06 was resolved. [/Users/julialerman/Dropbox/ConferenceStuff/Devintersection 2017/EFCore2/EFCore2Demo/EFCore2Demo.csproj]
warning NU1603: NETStandard.Library 2.1.0-preview1-25407-01 depends on Microsoft.Packaging.Tools (>= 1.0.0-preview1-25407-01) but Microsoft.Packaging.Tools 1.0.0-preview1-25407-01 was not found. An approximate best match of Microsoft.Packaging.Tools 1.0.0-preview2-25224-01 was resolved.
Here is my csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1-*" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1-*" />
</ItemGroup>
</Project>
Are we getting close to having a preview package available on nuget.org?
@komby we're not planning to put preview packages on nuget.org, so please use the MyGet.org test feed in the meantime. The final release is coming up very soon so it shouldn't be a long wait.
@Eilon: Can you share a timeframe with us? Is it days or weeks? We are facing a bug which is fixed in this release but this keeps us from using it in production.
@wesselkranenborg Around mid of November 😄
Is it possible to use this preview package on Azure App Service? I cannot get my asp.net web application running there when I use the new preview package.
@rodyvansambeek It is possible to publish this to Azure App Service. You need to use the PublishWithAspNetCoreTargetManifest flag during deployment. More information on this flag can be found here: https://docs.microsoft.com/en-us/dotnet/core/deploying/runtime-store#aspnet-core-implicit-store
@natemcmaster also mentions this in his comment: https://github.com/aspnet/Home/issues/2254#issuecomment-339709628
@Eilon With those three security announcements and the patches that hit NuGet a few hours ago, are the 2.0.3 changes from this pre-release included there? The version numbers are really confusing (e.g. the meta package is on 2.0.3, Razor is on 2.0.1) and there are no tags in the GitHub repositories yet that match the available releases.
@poke , yes, yesterday's release has all the patch fixes that were in the public test feed, plus a few others.
We did just add tags to the repos today/yesterday to hopefully clear a few things up.
But, we do recognize that the version numbers are still a bit confusing and we're having some discussions to see how we can simplify them even more.
Now this version is already published to nuget.org, but we can still get assembly not found exception when deploy on Azure Web Service without the PublishWithAspNetCoreTargetManifest flag.
@kinosang That's because the deployment to Azure App Service is not yet finished. See here: https://github.com/Azure/app-service-announcements/issues/61
@davidebbo Since I can't comment on Azure/app-service-announcements#61 ... I'm unable to get my apps working with the latest 2.0.3 package / sdk on azure at all.. This is not good and the csproj changes did nothing to help.
@niemyjski Can you start a question on the Web App MSDN forum or on StackOverflow? Make sure to include a minimal repro and details on how you're deploying.
waiting for the next release...
a long horn
Hey guys, first time around.
I have the same issue that @tiagorosendo posted.
When I try to Ignore(x => x.ValueObject) or even Ignore(x => x.AggregateEntity) it throws Object reference not set to an instance of an object at Microsoft.EntityFrameworkCore.Metadata.Internal.InternalModelBuilder.RemoveEntityType(EntityType entityType, ConfigurationSource configurationSource).
I have tried EF Core 2.0.2 and 2.1.0-preview1-final.
Both throws the same error.
You can find my sample at https://github.com/digogid/eStore.Sample
I was trying to do it, running 'eStore.MigrationRunner' as startup project.
Hi @digogid , if this is an issue with EF Core, can you please log a new issue in https://github.com/aspnet/EntityFrameworkCore/issues with steps to reproduce? Thanks!
We periodically close 'discussion' issues that have not been updated in a long period of time.
We apologize if this causes any inconvenience. We ask that if you are still encountering an issue, please log a new issue with updated information and we will investigate.
I solved this error by installing the following packages From package manager console
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.4">
Most helpful comment
@poke , yes, yesterday's release has all the patch fixes that were in the public test feed, plus a few others.
We did just add tags to the repos today/yesterday to hopefully clear a few things up.
But, we do recognize that the version numbers are still a bit confusing and we're having some discussions to see how we can simplify them even more.