none
Loading Bitmap resource from .net library with ASP.NET Core RRS feed

  • Question

  • I have a library that is written in VB.net and i have to use it with my ASP.NET Core application. It has some resource files that it needs to load up during runtime to generate specific output bitmap.

    What happens is I'm getting following error trying to use bitmap file from resources: 

    System.NotSupportedException: 'Cannot read resources that depend on serialization'

    If _Document.Document.Pages.IndexOf(SigField.Widgets.Item(0).Page) = p_PageNumber Then
                        If CItem.Captured Then
                            'Draw Check
                            AnnImage = My.Resources.tick_64
                        Else
                            'Draw tag
    'this line generates exception
                            AnnImage = My.Resources.sign_here_tag
    
                            'Resources.ResourceManager rm = New Resources.ResourceManager("test.g", Reflection.Assembly.GetExecutingAssembly())
                        End If


    • Edited by Ankingster Tuesday, November 13, 2018 1:27 PM
    • Moved by CoolDadTx Tuesday, November 13, 2018 2:51 PM ASP.NET related
    Tuesday, November 13, 2018 1:03 PM

All replies

  • Hi,

    can you show us some code?(If I would just get a cent for asking that all the time...)

    Why serialization instead of using Image.FromFile("bitmap.bmp"); from System.Drawing?

    Greetings, Chris

    Tuesday, November 13, 2018 1:24 PM
  • Chris,

    Thanks for the quick response! I just updated the question to show some code. I unfortunately cannot upload pictures yet

    I was trying to use library the way it was originally written. Everything was inside the resources and was working fine in winforms app.
    • Edited by Ankingster Tuesday, November 13, 2018 1:29 PM
    Tuesday, November 13, 2018 1:28 PM
  • Hi Ankingster,

    to show some code is better so, thanks to providing it ;).

    Oh, now I see, you want to write it in VB? So you should post it the the visual basic forum but You post it in the c# forum. Maybe a moderator can move it there.

    Greetings, Chris

    Tuesday, November 13, 2018 2:49 PM
  • Please post questions related to ASP.NET Core in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, November 13, 2018 2:51 PM
  • @Michael Taylor,

    Same question again:

    Why do you move it to "Off-Topic" instead of moving it to the correct forum? This is not a repoach, I just want to understand the reason. Is it not possible to move it there?

    Greetings, Chris

    Tuesday, November 13, 2018 3:04 PM
  • I know its confusing, but I posted in C# because my ASP.Net core is in C#.

    This particular library i'm using is in VB and i'm trying to keep it as intact as possible because it is still used by a winforms application. So, if any change is made it should be back-compatible with the winforms application.(that is also written mostly in VB)

    So which forum should I use then? VB, C# or ASP.NET?

    • Edited by Ankingster Tuesday, November 13, 2018 3:48 PM
    Tuesday, November 13, 2018 3:45 PM
  • As Michael said, it should be posted in the ASP.NET forum.

    Greetings, Chris


    • Edited by DerChris88 Tuesday, November 13, 2018 4:05 PM
    Tuesday, November 13, 2018 4:04 PM