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.

AzureServiceTokenProviderException not marked Serializable

See original GitHub issue

I get an error when doing a full publish build of an ASP.Net MVC 5 application. It occurs during the step that compiles and merges views (aspnet_compiler.exe)

Error ASPRUNTIME: Type 'Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException' in assembly 'Microsoft.Azure.Services.AppAuthentication, Version=1.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not marked as serializable.

Checking the code, it looks like Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException indeed is not marked as serializable. Other exception classes in other libraries have this clause at the top:

#if FullNetFx
    [Serializable]
#endif

(ie, Microsoft.Rest.HttpOperationException)

Is this an oversight on the AzureServiceTokenProviderException class, or should I look elsewhere?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
adfewcommented, Apr 26, 2019

It is serializable now but it still not working. Now exception message looks like that:

System.Runtime.Serialization.SerializationException: The constructor to deserialize an object of type ‘Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException’ was not found.

Try to unit test this functionality after fix it 😃

0reactions
rushilShettycommented, Nov 26, 2020

@dgliwa @dil-bpecor I’m having the same issue now

##[error]ASPNETCOMPILER(0,0): Error ASPRUNTIME: Type is not resolved for member ‘Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException,Microsoft.Azure.Services.AppAuthentication, Version=1.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’

I have a aspnet project which builds fine locally, but on Azure DevOps I get this same exact error. We use our own build agent. I installed Visual studio on it and built and that’s fine. But when I use it with MSbuild.exe, I get the above error.

I don’t have /p:PrecompileBeforePublish parameter any where in our project. Even then I provided it /p:PrecompileBeforePublish=false, but it still doesn’t seem to work. Would you know perhaps any other reason?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Error - is not marked as serializable
Type 'OrgPermission' in Assembly 'App_Code.ptjvczom, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
Read more >
Error in Visual Studio Designer: "Type ... is not marked as ...
Apperantly the designer tries to serialize these properties and end up with the error. public partial class _GenericGridViewControl<T> : ...
Read more >
Error "AppearanceObject not marked as serializable"
Hello I have a question concerning serialization. I am not sure whether this is a devexpress or a general coding error of mine....
Read more >
T4 System.Runtime.Serialization.SerializationException
Implementation, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable. Server stack trace:
Read more >
CA2235: Mark all non-serializable fields (code analysis)
SerializationException exception is thrown if the type contains an instance field of a type that's not serializable and doesn't implement ...
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