efcore icon indicating copy to clipboard operation
efcore copied to clipboard

The process has no package identity

Open TonyValenti opened this issue 6 years ago • 12 comments

Using EFCore with SQLITE now causes the error: System.InvalidOperationException: 'The process has no package identity. (Exception from HRESULT: 0x80073D54)'

From the following module: Microsoft.Data.Sqlite.Utilities.ApplicationDataHelper.LoadAppData

It looks like it is using reflection to do some calls. Can this be updated to not throw?

TonyValenti avatar Jun 10 '20 18:06 TonyValenti

@TonyValenti Please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.

ajcvickers avatar Jun 11 '20 14:06 ajcvickers

I have the same problem. Just updated Microsoft.EntityFrameworkCore.Sqlite to 3.1.5 Here's a little reproduction ConsoleApp1.zip

NatPerat avatar Jun 12 '20 14:06 NatPerat

@TonyValenti @NatPerat I ran the project on two machines (Ubuntu Linux and Windows 10) and it worked fine in both places. Which operating system/version are you on where this is failing?

ajcvickers avatar Jun 12 '20 18:06 ajcvickers

@ajcvickers - The exception is an internal one that is swallowed by the code. In VS, tell it to break on every exception and you'll see it happen.

TonyValenti avatar Jun 12 '20 18:06 TonyValenti

@TonyValenti I still don't see an exception. However, a handled exception in this case is by-design. Why is this causing issues for you?

ajcvickers avatar Jun 12 '20 18:06 ajcvickers

The project seems to be running fine regardless of the exception. But I was worried it might have other implications. The System.InvalidOperationException was not there in the previous versions. So when I searched and found this issue I thought I should dig a little.

I run windows 10 with the latest dotnet core sdk and the .net framework 4.8 alongside.

Long time user, love the project. Thanks for your time.

NatPerat avatar Jun 12 '20 19:06 NatPerat

I have this exact same issue, even disabling all C# exceptions in the exception settings won't help. The program consistently breaks when trying to open a sqlite connection. The console app provided earlier as an example also reproduces this problem for me. I'm running vs2019 16.6.2. So as a consequence, each time I run my program in the debugger, I get this exception thrown in my face, then have to press F5 to continue debugging.

image

jeroenwalter avatar Aug 07 '20 08:08 jeroenwalter

I have same issue as @jeroenwalter, it runs fine .net core, but for .net 4.8, same exception. edit: Not related to EF Core, have same issue with Dapper.

knilecrack avatar Sep 09 '20 04:09 knilecrack

I got rid of this exception after enabling the "Enable Just my code" option in the debugging options....

image

jeroenwalter avatar Sep 09 '20 18:09 jeroenwalter

Why had this issue been closed? Is this really by design to throw an exception? I don't even know what is wrong in my code and why I get this exception...

@jeroenwalter's answer isn't a solution, it's a workaround. By enabling Just my code we can't use SourceLink anymore!

jmevel avatar Apr 06 '21 07:04 jmevel

This exception being InvalidOperationException is also especially bad because it means if you filter IOEs from the SQLite assembly, any ones of actual significance will be silenced. That's undesirable, it should at least be a more specific exception type.

kg avatar Jul 29 '21 16:07 kg

Linking to the relevant code, in case it's helpful for someone: https://github.com/dotnet/efcore/blob/8144d50ec0d15b87c35a9a3a425b1faadafb87f1/src/Microsoft.Data.Sqlite.Core/Utilities/ApplicationDataHelper.cs#L30

Eli-Black-Work avatar Nov 15 '21 05:11 Eli-Black-Work