question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to load From NetStandard 2.0 Library "PCL" EmbeddedResource

See original GitHub issue

Description

Hello, I’m unable to load Sample.svg from Sample code. My “PCL” is type of NetStandard Library 2.0. I have added a folder called Resources and inside it I added the sample svg from the sample project selecting the image as EmbeddedResource.

PD: I’m also using native forms.

Expected Behavior

I do this in XAML

    xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms">

<ffimageloadingsvg:SvgCachedImage
                WidthRequest="200"
                HeightRequest="200"
                Source="resource://MyProject.Resources.Sample.svg" />

And it should show the image in 200x200

Actual Behavior

Nothing happens

Basic Information

  • Version with issue: 2.3.4
  • Last known good version: I used ffimageloading in native projects and Forms PCL projects.
  • Platform: iOS but I suppose Android too.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
daniel-luberdacommented, Mar 29, 2018

@nexussays I modified lib to throw an exception if CachedImageRenderer.Init is not called: https://github.com/luberda-molinet/FFImageLoading/commit/cc221ff94284b980c11e41be6ffe69117339f726

0reactions
nexussayscommented, Mar 27, 2018

Seems to be caused by forgetting to call CachedImageRenderer.Init(); in your Activity or AppDelegate. @CarLoOSX does that fix it for you too?

Is this documented anywhere? I see it in the SVG page but it’s incidental to the topic of that section and I presumed it was just needed if I was using CachedImage.

There should really be a runtime exception thrown if CachedImageRenderer.Init(); isn’t called.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Embedded resource in .Net Core libraries
UPDATE: .NET Core 1.1 and later have dropped project.json and returned to .csproj files. This changes Step 2, but not all that much....
Read more >
Why not able to load netstandard.dll when creating new ...
dll you are trying to load is a reference assembly that which cannot be loaded for runtime on .NET Framework as pointed out...
Read more >
Unable to create an Analyzer targeting Roslyn 2.0 #18414
You are trying to install this package into a project that targets '. ... NET Standard 1.3 libraries instead of PCL libraries?
Read more >
Getting Started: Xamarin Forms with .NET Standard
NET Standard support we need to replace the PCL with a .NET Standard library. Whilst Visual Studio used to have a mechanism for...
Read more >
Add System.ComponentModel.DataAnnotations to .NET ...
I have started to upgrade our Domain / Logic libraries from PCL and full . ... NET Standard 2.0 libraries. ... I've tried...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found