-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commands: WACK binary analyzer fails when adding EF Core in UWP class library #5069
Comments
@davesmits what version of EF Core are you using (RC1 or the nightly RC2 builds)? |
RC1. tried to get RC2 from myget but nuget refused to install that package nuget error to include that package: or do i also have to use the updated .net core packages? |
i just updated everything to the rc2 version from myget (included .netcore) and now when building a release build it returns very quickly this error: Severity Code Description Project File Line Suppression State |
@davesmits yeah RC2 won't work with .NET Native until some new UWP is made public - the .NET Native team has some new work coming that helps solve a lot of the .NET Native issues that we had in RC1. We've assigned this to someone to investigate since we haven't seen these particular failures before and want to make sure they won't carry over into future releases. |
Actually, this UWP tooling just released publically last week. It's a little hard to see, but you need to have .NET Native SDK 1.3.1 installed and use Microsoft.NetCore.UniversalWindowsPlatform 5.1.0. Also, make sure you are building with "Compile with .NET Native tool chain" enabled (on by default in "Release" mode.) The release was announced here: https://blogs.msdn.microsoft.com/visualstudio/2016/04/11/whats-new-in-vs-2015-update-2-for-universal-windows-developers/ |
i did this with the 1.3.1 release; before that release the number of generics EF core used let the compiler go out of memory. .net native feedback alias helped me to figure that out. If using .net core 5.1 EF RC2 doesnt want to install and with the RC1 having those errors as mentioned on top |
@davesmits can you share your project.json and project.lock.json? |
@natemcmaster when using .netcore 5.1 and rc 1? |
Ms.NetCore.Uwp 5.1 and RC2. These should work, which is why I'm asking. If they don't, then we need to re-open #4802 |
which myget url i can best use? i am now using https://www.myget.org/F/aspnetcirelease/api/v3/index.json (changed it this evening) and the EF library is now 7.0.0.0-RC1-update1 |
I'd recommend https://www.myget.org/F/aspnetrelease/api/v3/index.json. It's been through testing. https://github.com/aspnet/Home/wiki/NuGet-feeds Here is my project.json {
"dependencies": {
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.0-rc2-20581",
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0",
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
} |
if i add via the nuget UI i get this error: Package restore completed successfully for 'XpertFinder.Model'. |
the binary analyzer of wacks returns less faults.. but still some: File C:\Program Files\WindowsApps\SparkedApps.XpertFinder_2.1.51.0_x86__pkpvvn6f26pj6\sqlite3.dll has failed the AppContainerCheck check. |
I just tried using the WACK on a UWP app with EF RC2, compiled in release mode. Everything passed for me (except the branding...guess it didn't like my logos). http://bl.ocks.org/natemcmaster/raw/aee79d6c21abd5413ab7607f80552bc0/ |
I found the situation where it goes wrong. If you create a class library and reference emtityframework.sqlite and entityframework.commands in that class library, then from your app reference to that class library you will get errors. i added a sample where i have 2 empty projects and getting this error And to clarify this. in my app i have 3 projects:
|
I got same issue on my app. I think Also include some API test failed:
|
I believe what is happening here is a limitation in the workaround Microsoft.Data.Sqlite has to ensure your project gets the right version of Explanation: |
any hints how to do? i tried to add sqlite extension to my project but that gives error about a double file as payload. Also tried to remove the sqlite3.dll as post build action in my class library and then add the file again but so far no real luck :( i just tried this in the app project as post build action: But it didn't really fix the problem. coreclr is still dragged for instance... to be honest. this limitions is making EF useless for any serious app.. Background Tasks are very important part of apps and force developers to use this kind of structure. |
So I use sqlite.net-pcl now, everything fine...... o(^_^)o |
I confirmed the issue, but the issue is not in EF. The issue is in how Microsoft.Data.Sqlite is packaged. The workaround is to add Microsoft.Data.Sqlite as direct dependency of your app. When it is brought in as a transitive dependency, NuGet gets the wrong native binaries. Moving to aspnet/Microsoft.Data.Sqlite#245 |
Found that this is actually 2 issues. First the sqlite3.dll issue aspnet/Microsoft.Data.Sqlite#245. Second issue: Microsoft.EntityFrameworkCore.Tools (called EntityFramework.Commands in RC1) brings in the CLR when this is listed as a dependency of a class library that is used in UWP. ReasonThis package uses MSBuild to do some funky dll swapping in order to enable package manager console commands. This MSBuild logic looks for "UseDotNetToolchain" to determine whether to do this swapping or not. Class libraries never have UseDotNetToolchain set to true, even in release mode, so our MSBuild script is incorrectly putting the wrong Microsoft.EFCore.Tools dll into output. Workaround
|
cc @rowanmiller @divega this limitation is going to affect RC2 release |
I believe the workarounds are acceptable for RC2, but we need to mention them in any relevant documentation and release notes. |
@natemcmaster can you make sure this gets added to the list of known issues in our docs |
Closing to consolidate bugs. This is essential the same issue as #3682. I'll add this scenario to that issue. |
Fixed in #5474 |
@natemcmaster Can we expect to see the fix in the 1.0.0 milestone (27th June 2016)? |
@Herdo Yes, the fix for this issue and aspnet/Microsoft.Data.Sqlite#245 will be in the next release. If you want to try out the fixes early, you are welcome to use our nightly feeds. |
@natemcmaster Thanks for the info! I'll be patient and use the workaround while waiting 12 more days. |
I am using Entity Framework core in my UWP. But since that wack fails with lot of errors but mainly because this:
this blocks me to get the app in the store. As soon i remove the EF pacakges the errors are gone. Any known issues on this or know how to fix this?
The text was updated successfully, but these errors were encountered: