Skip to content
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

System.TypeInitializationException #169

Closed
factormystic opened this issue Aug 8, 2014 · 1 comment
Closed

System.TypeInitializationException #169

factormystic opened this issue Aug 8, 2014 · 1 comment
Labels

Comments

@factormystic
Copy link

I installed Akavache 4.0 via nuget, and with this code, I get the exception (WP8.1 WinRT project):

var image = new BitmapImage();
var source = ...

var sb = await BlobCache.LocalMachine.LoadImageFromUrl(source);

using (var ms = new MemoryStream())
{
    await sb.Save(CompressedBitmapFormat.Png, 1.0f, ms);
    image.SetSource(System.IO.WindowsRuntimeStreamExtensions.AsRandomAccessStream(ms));
}

Exception details:

{System.TypeInitializationException: The type initializer for 'Akavache.BlobCache' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Splat, Version=1.3.3.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Akavache.DependencyResolverMixin.InitializeAkavache(IMutableDependencyResolver This)
   at Akavache.BlobCache.<.cctor>b__0()
   at Splat.Locator.RegisterResolverCallbackChanged(Action callback)
   at Akavache.BlobCache..cctor()
   --- End of inner exception stack trace ---
   at Akavache.BlobCache.get_LocalMachine()
   at (my program here)

The "The located assembly's manifest definition does not match the assembly reference." part is likely the issue here. I'm using Splat in the source, and I see Splat in my project references, and I have Splat.dll in packages\Splat.1.3.3\lib\Portable-Win81+Wpa81, but when I inspect the file, it's not version 1.3.3.0, it's version 0.0.0.0:

ss

@anaisbetts
Copy link
Member

Can you file this bug against Splat instead? Just copy-paste everything

@lock lock bot added the outdated label Jun 25, 2019
@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants