0

I have an .NET core 3.1 API project which has reference to third party .NET dll (reference handled through windows compatibility pack).

Getting TypeLoadException inside the catch block (as shown in first screenshot)

The exception object has all details when viewed in debug mode including stack trace details. Getting below exception only when logger tries to read stack trace Information.

Able to see Stacktrace information when viewed through exception object, but get type error when drilled down to exception.Stacktrace

enter image description here

enter image description here

When I try to read stacktrace:

enter image description here

3
  • Please rework your question. You need to put in stuff like "The below screen shows what I see in the VS debugger window". Your question is a little hard to follow as is. Commented Mar 23, 2022 at 18:13
  • Agree with @granadaCoder. Can you please explain what you mean by "read the stack trace"? Are you trying to assign it to a variable, or simply view it in the debugger? Commented Mar 23, 2022 at 18:17
  • Thanks. tried to reframe, please check Commented Mar 23, 2022 at 18:25

1 Answer 1

1

ToolboxDataAttribute from Namespace:System.Web.UI and Assembly: System.Web.dll is not compatible with .Net core according to the following official documentation: https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.toolboxdataattribute?view=netframework-4.8#applies-to

Try to find an alternative lib that gives same functionality as ToolboxDataAttribute and it is compatible with .Net core.

One work around for this is by moving your logic which uses ToolboxDataAttribute to the class library .NET Standard 2.0. Then you will be able to reference this class library from both .NET Core and .NET Framework projects.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for detailed explanation and solution option.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.