Exception type: FileNotFoundException Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0,

Posts   
 
    
sherifr
User
Posts: 11
Joined: 26-Apr-2018
# Posted on: 05-Jul-2018 13:21:43   

Hi, I encounter this error when I try to sync my Relational Model.

Exception message:

Exception type: FileNotFoundException Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Attached screenshots of the error and build.

Thanks.

Attachments
Filename File size Added on Approval
2018-07-05 13_20_00-Action center.png 54,261 05-Jul-2018 13:22.30 Approved
2018-07-05 13_21_57-Start.png 66,870 05-Jul-2018 13:22.37 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39570
Joined: 17-Aug-2003
# Posted on: 05-Jul-2018 15:39:48   

I think you use an Npgsql version which requires a .NET full version you don't have installed yet, please install .net 4.7.2 and try again

Frans Bouma | Lead developer LLBLGen Pro
sherifr
User
Posts: 11
Joined: 26-Apr-2018
# Posted on: 05-Jul-2018 21:16:28   

I have it already installed and I also, updated the Npgsql driver to 4.0.1. Still see the problem.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39570
Joined: 17-Aug-2003
# Posted on: 06-Jul-2018 11:12:26   

Could you please click the 'copy to clipboard' button in the exception dialog so you get a stacktrace (just paste it here in a new post). We don't use that assembly so it's something related to npgsql.

Frans Bouma | Lead developer LLBLGen Pro
dodyg
User
Posts: 42
Joined: 04-Dec-2014
# Posted on: 07-Jul-2018 14:33:45   

I also encounter the same problem (https://github.com/npgsql/Npgsql/releases) using Npgsql v4.0.1


Exception information.
=============================================================
LLBLGen Pro version: v5.4. Build: 5.4.1

Exception details:
=====================
Message: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Source: System.Threading.Tasks.Extensions
Stack trace: 
   at System.Threading.Tasks.ValueTask`1.get_IsCompleted()
   at Npgsql.NpgsqlConnection.<>c__DisplayClass32_0.<<Open>g__OpenLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Npgsql.NpgsqlConnection.Open()
   at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ConnectionData.TestConnectionData(Boolean showSuccess)

Inner exception: <null>


Otis avatar
Otis
LLBLGen Pro Team
Posts: 39570
Joined: 17-Aug-2003
# Posted on: 08-Jul-2018 09:38:03   

Looks like a problem with npgsql, but not sure if it's .net full version related. You too have .net 4.7.2 installed?

Frans Bouma | Lead developer LLBLGen Pro
sherifr
User
Posts: 11
Joined: 26-Apr-2018
# Posted on: 08-Jul-2018 09:59:48   

Exception information.

LLBLGen Pro version: v5.4. Build: 5.4.1

Exception details:

Message: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Source: System.Threading.Tasks.Extensions Stack trace: at System.Threading.Tasks.ValueTask`1.get_IsCompleted() at Npgsql.NpgsqlConnection.<>c__DisplayClass32_0.<<Open>g__OpenLong|0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Npgsql.NpgsqlConnection.Open() at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ConnectionData.TestConnectionData(Boolean showSuccess)

Inner exception: <null>

Also, I opened an issue in the Npgsql repository, but I seem to be not able to answer his question. Kinda took it on my behalf sunglasses https://github.com/npgsql/npgsql/issues/2049

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39570
Joined: 17-Aug-2003
# Posted on: 08-Jul-2018 12:52:00   

thanks for that simple_smile

He wants you to post the C# project file (the csproj file) you created for the project which you used to reproduce the issue as that csproj file (the xml) contains the references you have, he suspects you miss a reference. I think it's something else but don't know what exactly. I replied as well, perhaps that gives more insight to roji what it can be.

Frans Bouma | Lead developer LLBLGen Pro
sherifr
User
Posts: 11
Joined: 26-Apr-2018
# Posted on: 08-Jul-2018 12:58:30   

I know that when I said "I just open a NpgsqlConnection", I was talking about me as LLBLgen designer developer, right simple_smile ?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39570
Joined: 17-Aug-2003
# Posted on: 08-Jul-2018 16:57:05   

Please see the github thread, it's an issue with the npgsql installer, some assemblies need to be added to the gac to make this work (for the designer at least), i.e. for DbProviderFactories to work

Frans Bouma | Lead developer LLBLGen Pro
dodyg
User
Posts: 42
Joined: 04-Dec-2014
# Posted on: 11-Jul-2018 10:36:32   

This problem is solved with the latest installer Npgsql v4.0.2

https://github.com/npgsql/npgsql/releases

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39570
Joined: 17-Aug-2003
# Posted on: 11-Jul-2018 16:13:15   

Thanks for the heads up!

Frans Bouma | Lead developer LLBLGen Pro
JSobell
User
Posts: 145
Joined: 07-Jan-2006
# Posted on: 08-Oct-2019 15:02:42   

Looks like the same issue may be back:


Exception information.
=============================================================
LLBLGen Pro version: v5.6. Build: 5.6.1

Exception details:
=====================
Message: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Source: System.Threading.Tasks.Extensions
Stack trace: 
   at System.Threading.Tasks.ValueTask`1.get_IsCompleted()
   at Npgsql.NpgsqlConnection.<>c__DisplayClass32_0.<<Open>g__OpenLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Npgsql.NpgsqlConnection.Open()
   at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ConnectionData.TestConnectionData(Boolean showSuccess)

Inner exception: <null>


Otis avatar
Otis
LLBLGen Pro Team
Posts: 39570
Joined: 17-Aug-2003
# Posted on: 08-Oct-2019 15:14:58   

You're using their latest build? If not, could you open a new issue on the npgsql repo? There's little we can do, I'm afraid.

These are the shipped releases and release notes. https://github.com/npgsql/npgsql/releases

Frans Bouma | Lead developer LLBLGen Pro
JSobell
User
Posts: 145
Joined: 07-Jan-2006
# Posted on: 09-Oct-2019 13:53:58   

Otis wrote:

You're using their latest build? If not, could you open a new issue on the npgsql repo? There's little we can do, I'm afraid.

These are the shipped releases and release notes. https://github.com/npgsql/npgsql/releases

Yes, it's already been commented on https://github.com/npgsql/npgsql/issues/2677 I've gone back to an older version of npgsql until they fix it.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39570
Joined: 17-Aug-2003
# Posted on: 09-Oct-2019 14:39:00   

I think there's a reason why it occurs: The minimum dependency on .NET Framework for Npgsql is 4.6.1. The designer however uses 4.5.2.

~~If you have 4.6.2 installed, and you change in the llblgenpro.exe.config file the following line: <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />

to <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />

does it then load the 4.1.1 npgsql driver?~~ (doesn't work)

In the next version of llblgen pro (5.7) we'll move to 4.6.2 or higher, to overcome this problem, as I was reminded this morning that google spanner makes a move to 4.6.2 soon, and now reading this I realize this might be the problem with 5.6.x.

I'll try to reproduce it here too.

(edit) hmm, setting that version to a higher version doesn't work. It's then indeed something related to npgsql.

Frans Bouma | Lead developer LLBLGen Pro
Benjamin23
User
Posts: 26
Joined: 15-Nov-2017
# Posted on: 14-Feb-2020 14:24:59   

Hi Otis,

Was there any progress on this (if it is possible to resolve it on LLBLGen Designer side at all)?

We'd like to upgrade to latest version of Npgsql, but we're seeing same issue. I see that issue on github is still open. Is there anything you can do, or we need to wait for fix from Npgsql.

Cheers

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 15-Feb-2020 06:33:27   

I read this thread completely and the npgsql's thread as well. It seems you will have to wait for a fix from npgsql.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39570
Joined: 17-Aug-2003
# Posted on: 15-Feb-2020 09:55:05   

Yeah it's still not fixed and I think they can't fix it too without dropping support for a version of an assembly they reference as it's due to a reference they have that causes this. I do recall there's a workaround listed in the Npgsql github thread, did you try that?

Frans Bouma | Lead developer LLBLGen Pro