Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Incorrect native library imported to UWP apps when Microsoft.Data.Sqlite is a transitive dependency #245

Closed
natemcmaster opened this issue May 3, 2016 · 15 comments
Assignees
Milestone

Comments

@natemcmaster
Copy link
Contributor

Uwp.App/
     Depends on Uwp.Model
Uwp.Model/
     Depends on Microsoft.Data.Sqlite

When building appx packages for uwp.app, sqlite3.dll for win32, not winrt, is included in the build output.

Workaround

Explicitly add Microsoft.Data.Sqlite as a dependency of Uwp.App

  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0",
    "Microsoft.Data.Sqlite": "1.0.0-*"
  }

Root cause of dotnet/efcore#5069. Hopefully we can resolve this with a solution for #237

@davesmits
Copy link

the workaround isn't enough. It solves the errors related to sqlite3.dll but still some errors are still there:

File C:\Program Files\WindowsApps\c85acd3f-9a0c-4f43-8a92-6ef726e7bfd1_1.0.14.0_x86__5q3b35137xmx2\coreclr.dll has failed the AppContainerCheck check.
◦File C:\Program Files\WindowsApps\c85acd3f-9a0c-4f43-8a92-6ef726e7bfd1_1.0.14.0_x86__5q3b35137xmx2\dbgshim.dll has failed the AppContainerCheck check.
◦File C:\Program Files\WindowsApps\c85acd3f-9a0c-4f43-8a92-6ef726e7bfd1_1.0.14.0_x86__5q3b35137xmx2\mscordaccore.dll has failed the AppContainerCheck check.
◦File C:\Program Files\WindowsApps\c85acd3f-9a0c-4f43-8a92-6ef726e7bfd1_1.0.14.0_x86__5q3b35137xmx2\mscordbi.dll has failed the AppContainerCheck check.

@natemcmaster
Copy link
Contributor Author

These failures come from a package separate from Microsoft.Data.Sqlite. Microsoft.Data.Sqlite and EF don't pull in CoreCLR.

Is it possible this is a project configuration error? When you create appx, are you using Release mode with ".NET Native toolchain" enabled? I can only get these errors when I run WACK on an appx built in "Debug" mode.

If you're sure your project settings are setup correctly, then there could be an issue in the UWP package itself. https://github.com/dotnet/corefx.

image

@davesmits
Copy link

you right with just entityframework.sqlite in the class library is passes. goes wrong when adding entityframework.commands nuget package to the class library

@natemcmaster
Copy link
Contributor Author

Thanks for that clue @davesmits. Re-opened dotnet/efcore#5069. The WACK failure was actually two bugs.

@MMalikKhan
Copy link

@natemcmaster @davesmits @divega @rowanmiller i am also getting this error, i have EF7 RC1, using the latest 1.3.2 tool chain. I previous gave a shot to update to RC2 but bump into other issues with the database file not being created with the RC1 migrations in it .. Is there any work around i can do to fix this in my solution. this is something very critical as the app needs to go live ASAP and this is just stopping us from publishing to store. I appreciate your quick response
thanks

@divega
Copy link

divega commented May 26, 2016

@MMalikKhan there are workarounds listed at dotnet/efcore#5069 (comment) and they should also be in the release notes for RC2.

@MMalikKhan
Copy link

@divega thank you, you talking about the below work around? looking at the that #5069 i am little lost it is for RC2 or RC1 i want it to work for RC1.
I am still not clear what is the suggestion below ? could you please break it further simple for me .. ?
thanks

Put the dependency on Ms.EfCore.Tools in the application project, not the class library
Or, when preparing to release, remove this dependency. It is only needed for package manager console commands, and is not necessary for the app to execute correctly.

@divega
Copy link

divega commented May 26, 2016

@MMalikKhan sorry, I missed entirely that you are talking about RC1. @natemcmaster might be able to answer.

@MMalikKhan
Copy link

thanks @divega @natemcmaster just to clarify these are the errors reported by the WACK and also by store validation.

File coreclr.dll has failed the AppContainerCheck check.
File dbgshim.dll has failed the AppContainerCheck check.
File mscordaccore.dll has failed the AppContainerCheck check.
File mscordbi.dll has failed the AppContainerCheck check.

once the above errors comes then there are heaps of errors related all these four dlls are thrown in the Supported API tests, i just pasted few of them.. here

Supported APIs
Error Found: The supported APIs test detected the following errors:
API K32EnumProcessModules in api-ms-win-core-psapi-obsolete-l1-1-0.dll is not supported for this application type. dbgshim.dll calls this API.
API K32GetModuleFileNameExW in api-ms-win-core-psapi-obsolete-l1-1-0.dll is not supported for this application type. dbgshim.dll calls this API.
API LocalFree in api-ms-win-core-heap-obsolete-l1-1-0.dll is not supported for this application type. dbgshim.dll calls this API.
API GetFileVersionInfoExW in api-ms-win-core-version-l1-1-0.dll is not supported for this application type. dbgshim.dll calls this API.
API GetFileVersionInfoSizeExW in api-ms-win-core-version-l1-1-0.dll is not supported for this application type. dbgshim.dll calls this API.
API VerQueryValueW in api-ms-win-core-version-l1-1-0.dll is not supported for this application type. dbgshim.dll calls this API.
API RegCloseKey in api-ms-win-core-registry-l1-1-0.dll is not supported for this application type. dbgshim.dll calls this API.
API RegOpenKeyExW in api-ms-win-core-registry-l1-1-0.dll is not supported for this application type. dbgshim.dll calls this API.
API RegQueryValueExW in api-ms-win-core-registry-l1-1-0.dll is not supported for this application type. dbgshim.dll calls this API.

@davesmits
Copy link

davesmits commented May 26, 2016

let me help. i been able to get my app in the store by doing these two things

  1. When building an app package for the store remove the entityframework.command package from all your projects
  2. if using Entityframework in class library make sure you add Microsoft.Data.Sqlite nuget package to your app project

based on your errors i think you only miss step 1 @MMalikKhan

@MMalikKhan
Copy link

thanks @davesmits I believe you want me to download the RC1 version of the Microsoft.Data.Sqlite to my PCL project. And when you said remove you mean physically delete from the package location or uninstall from nuget manager ?

@MMalikKhan
Copy link

@davesmits once i installed the Microsoft.Data.SQlite from nuget i am getting lots of compilation errors..
can you please let me know what else i am missing

Unable to satisfy conflicting requests for 'System.Reflection.Extensions': System.Reflection.Extensions (>= 4.0.0) (via package/EntityFramework.Core 7.0.0-rc1-final), System.Reflection.Extensions (>= 4.0.0) (via package/Microsoft.NETCore 5.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/System.Xml.XmlSerializer 4.0.10), System.Reflection.Extensions (>= 4.0.0) (via package/System.Private.ServiceModel 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/System.Private.ServiceModel 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/System.Private.ServiceModel 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/System.Private.ServiceModel 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/System.Private.ServiceModel 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/Microsoft.CSharp 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/System.Diagnostics.Tracing 4.0.20), System.Reflection.Extensions (>= 4.0.0) (via package/EntityFramework.Core 7.0.0-rc1-final), System.Reflection.Extensions (>= 4.0.0) (via package/Microsoft.CSharp 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/EntityFramework.Core 7.0.0-rc1-final), System.Reflection.Extensions (>= 4.0.0) (via package/Microsoft.CSharp 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/Microsoft.CSharp 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/System.Diagnostics.Tracing 4.0.20), System.Reflection.Extensions (>= 4.0.0) (via package/EntityFramework.Core 7.0.0-rc1-final), System.Reflection.Extensions (>= 4.0.0) (via package/Microsoft.CSharp 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/System.Linq.Expressions 4.0.10), System.Reflection.Extensions (>= 4.0.0) (via package/EntityFramework.Core 7.0.0-rc1-final), System.Reflection.Extensions (>= 4.0.0) (via package/Microsoft.CSharp 4.0.0), System.Reflection.Extensions (>= 4.0.0) (via package/System.Linq.Expressions 4.0.10), System.Reflection.Extensions (>= 4.0.0) (via package/System.Linq.Expressions 4.0.10), System.Reflection.Extensions (>= 4.0.0) (via package/System.Linq.Expressions 4.0.10)

@MMalikKhan
Copy link

@davesmits thanks option 1 did solved my issue ..

@davesmits
Copy link

@MMalikKhan so app submitted to the store?

@Herdo
Copy link

Herdo commented Jun 13, 2016

@davesmits Can we expect to see the fix in the 1.0.0 milestone (27th June 2016) of EntityFramework?
See #5069 of EntityFramework

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants