LINQPad Query Error - entity-framework

Problem: Can't properly setup LINQPad connection to my Entity Framework dll.
I downloaded LINQPad (v4.42.01)
I started to create a new connection using the Entity Framework DbContext POCO driver
At the setup dialog I pointed to my C# project's dll and it found the appropriate DbContext class.
Next I pointed the config file to the app.config of my C# project
When I hit the Test Button I get this error:
Error: The type initializer for
'System.Data.Entity.Internal.AppConfig' thre an exception. An error
occurred creating the configuration section handler for
entityFramework: Could not load file or assembly 'EntityFramework,
Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' on
one of its dependencies. The system cannot find the file specified.
(C:\Code\NET\FTI_Opp_Model\App.Config line 5)
So I tried doing what #Sorax did in this related question and moved my EntityFramework.dll from the one I got from NuGet in my project into the LINQPad.exe folder. This got me a little further along and the Test now worked. I was encouraged because my connection in the LINQPad panel showed all my entities underneath it.
But when I right click on my Borrower entity and chose "Borrower.Take(100)" I received this error from LINQPad:
The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.
With an inner exception message:
[A]System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection cannot be cast to
[B]System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection. Type
A originates from 'EntityFramework, Version=4.3.1.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' in the context 'Default' at location
'C:\MarkSisson\LinqPad\EntityFramework.dll'. Type B originates from
'EntityFramework, Version=4.3.1.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' in the context 'LoadFrom' at location
'C:\Users\msisson\AppData\Local\Temp\LINQPad\vlnebssu\shadow_ujjvzp\EntityFramework.dll'.
Any ideas?

Download the latest beta - this problem was fixed in 4.42.05.

Btw the important thing to understand that the type of the assembly also include WHERE IT WAS LOADED.
meaning two same assemblies loaded from different location are not the same type!

Related

Could not load file or assembly System.Linq.Dynamic.Core Version=1.0.15.0

Added System.Linq.Dynamic.Core Version=1.0.15.0 from nuget in current Asp.net core 1.1 project. Added required moethods in library but when method is called error is thrown as "Could not load file or assembly 'System.Linq.Dynamic.Core, Version=1.0.15.0, Culture=neutral, PublicKeyToken=0f07ec44de6ac832'. The system cannot find the file specified"
Tried to restore the package but no use

Using Accord.Imaging in UWP

(apologies for beginner question) I am trying to use Accord.Net Imaging function in an UWP windows 10 App. Any function I try gives me an error:
The type 'Bitmap' is defined in an assembly that is not referenced. You must add a reference to assembly 'CoreCompat.System.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.The type 'Bitmap' is defined in an assembly that is not referenced. You must add a reference to assembly 'CoreCompat.System.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
although I included Using System.Drawing (which includes Bitmap)
UnmanagedImage unmanagedImage = UnmanagedImage.FromByteArray(bytes);
If you're using NuGet, you can install the following package to get System.Drawing, and thus access to the Bitmap class: https://www.nuget.org/packages/CoreCompat.System.Drawing.v2/5.2.0-preview1-r131
Note that this is a prerelease version, so you'll need to check the box that says "Include prerelease" next to the search bar if using the Visual Studio NuGet GUI.

How to implement MixedReality-ToolKit into an existing HoloLens project?

I am extending the VideoCaptureExample for Hololens in Unity 2017.4.21f from this project: https://github.com/VulcanTechnologies/HoloLensCameraStream
Now I have to control the ScrollView and Buttons from my Canvas so I need the Gaze-Function from the MRTK. As soon as I try to implement the unitypackage from this page: https://github.com/Microsoft/MixedRealityToolkit-Unity/releases
for 2017.4.2.0 it shows me many C++ Exceptions while i didn't even use anything from that package:
Exception thrown at 0x76EDF2B2 (KernelBase.dll) in HoloLensVideoCaptureExample.exe: WinRT originate error - 0x80131534 : 'System.TypeInitializationException: The type initializer for 'WinRTBridge.WinRTBridge' threw an exception. ---> System.TypeInitializationException: The type initializer for 'WinRTBridge.TypeInformation' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'GLTFSerializationUWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
at UnityEngineInternal.BootstrapHelpers.FillTypeMaps0(Dictionary`2 , List`1 )
at UnityEng'.
Exception thrown at 0x76EDF2B2 (KernelBase.dll) in HoloLensVideoCaptureExample.exe: WinRT originate error - 0x80131534 : 'System.TypeInitializationException: The type initializer for 'WinRTBridge.WinRTBridge' threw an exception. ---> System.TypeInitializationException: The type initializer for 'WinRTBridge.TypeInformation' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'GLTFSerializationUWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
at UnityEngineInternal.BootstrapHelpers.FillTypeMaps0(Dictionary`2 , List`1 )
at UnityEng'.
Exception thrown at 0x76EDF2B2 in HoloLensVideoCaptureExample.exe: Microsoft C++ exception: Platform::COMException ^ at memory location 0x04EFE2F8. HRESULT:0x80131534 The text associated with this error code could not be found.
WinRT-Informationen: System.TypeInitializationException: The type initializer for 'WinRTBridge.WinRTBridge' threw an exception. ---> System.TypeInitializationException: The type initializer for 'WinRTBridge.TypeInformation' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'GLTFSerializationUWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
at UnityEngineInternal.BootstrapHelpers.FillTypeMaps0(Dictionary`2 , List`1 )
at UnityEng
I have already tried to check the Player Settings and took a research about it and I'm really stuck at this problem.
Here are my Player Settings from Unity:
I just took that version of MRTK and latest HoloLensCameraStream source. Running just the HoloLensCameraStream example produced some C++ TypeLoadExceptions; adding the MRTK 2017.4.2.0 didn't increase them nor did I see the GLTFSerializationUWP related typeload.
On the contrary I did see in the output that GLTFSerializationUWP was loaded successfully, as it's now included in your project as part of including MRTK.
Two options:
Generate a fresh UWP build from Unity into an empty folder
Try updating to a newer MRTK that no longer has the reference to GLTFSerializationUWP.dll
Hope that helps!

"Could not load file or assembly 'TypeMock.Interceptors, Version=0.0.0.0"

We have just upgraded Typemock from 6.0.2.0 to Typemock 7.3.0.0. And we now get the following error at runtime:
[System.IO.FileNotFoundException] = {"Could not load file or assembly 'TypeMock.Interceptors, Version=0.0.0.0, Culture=neutral, PublicKeyToken=0000000000000000' or one of its dependencies. The system cannot find the file specified.":"TypeMock.Interceptors, Version=0.0.0.0, Culture=neutral, Pu...
During debugging I can see that the source throwing it is mscorlib. The mystifying thing is that I have unloaded all of my projects that have references to Typemock.dlls but still get this error. When I choose "suspend mocking" in the Typemock-menu everything works.
In the GAC I can see that Typemock.Interceptors 7.3.0.0 is installed.
Any ideas?
I called TypeMock support, and they confirmed that it was a bug in TypeMock. They sent me a newer version (7.3.2.0) and the issue has now disappeared.

Autofac EnableInterfaceInterceptors Error

We updating to Autofac 2.4.4 after moving up to MVC3 and are receiving an exception when we include EnableInterfaceInterceptors on our registration. The exception does not appear until DependencyResolver.Current.GetService<ISite>() is called.
Exception:
Could not load type 'System.Func`2' from assembly 'App.AutofacContrib.DynamicProxy2, Version=2.4.4.705, Culture=neutral, PublicKeyToken=null'.
Registration:
builder.RegisterType<SendEmailTask>().As<ITask>().InstancePerDependency().EnableInterfaceInterceptors();
Note: In order to deal with conflicts in the different versions of Castle we performed an ILMerge on AutofacContrib.DynamicProxy2.dll and Castle.Core.dll.
Looks like a problem with the IL merge - rather than merging, have you tried assembly binding redirects?