question

MarcoSalvatori-5288 avatar image
0 Votes"
MarcoSalvatori-5288 asked lextm commented

Presentationcore in asp.net core 5.0

Hello,
I have to implement the Point, Pointcollection, vector classes in asp.net core 5.0.
it returns me an error simply to create a pointcollection

PointCollection test = new PointCollection ();

the error returned is:
System.BadImageFormatException: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)

help?

dotnet-aspnet-core-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

WPF classes are not supported to run in web apps. Why do you ever need them in your web app?

0 Votes 0 ·

1 Answer

SamWu-MSFT avatar image
0 Votes"
SamWu-MSFT answered

Hi @MarcoSalvatori-5288,

System.BadImageFormatException: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)


Did you post this error on iis? If so, you can try the solution below:

  1. Delete the PresentationCore package from the Bin folder and rebuild project.

  2. There may be a problem caused by binary format compatibility, set Enable 32-bit Applications to True or False.
    68049-58.png



If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



58.png (6.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.