Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6697639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:29:02+00:00 2026-05-26T06:29:02+00:00

I have been following an article on how to implement a custom Basic authentication

  • 0

I have been following an article on how to implement a custom Basic authentication with .net.

This is the article

The code uses an interface – IBasicUser – that derives from IIdentity.
The class BasicUser implements IBasicUser.
An instance of BasicUser is created and from that a GenericPrincipal is constructed.

IBasicUser bu = new BasicUser();
context.Context.User = new GenericPrincipal(bu, new string[] { });

When I run the code I get an exception.

Type 'Smithfamily.Blog.Samples.BasicUser' in assembly 'LM_TESTS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable. 

So I had a look at the System.Security.Principal.GenericIdentity class in Reflector and found that it is indeed marked with the attributes [Serializable. ComVisible(true)]

The Documentation on IIdentity doesn’t say anything about implementations needing to be serializable. From the exception and Reflector I assume however that it does. So I add the [Serializable] attribute to the BasicUser class.

Now I get a new exception when I run the code.

[SerializationException: Type is not resolved for member 'Smithfamily.Blog.Samples.BasicUser,LM_TESTS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.]

I am not very familiar with Serialization and don’t really understand what is going on or what the problem is. Please could you help enlighten me. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:29:03+00:00Added an answer on May 26, 2026 at 6:29 am

    Are you hosting your web site in the VS Web Development Server? If so, looks like you’ve stumbled onto a bug logged in MS Connect…

    http://connect.microsoft.com/VisualStudio/feedback/details/274696/using-custom-identities-in-asp-net-fails-when-using-the-asp-net-developement-server

    If I read this and the other posts about it correctly, the fix is GACing your DLL so that it can be found by .NET probing correctly and loaded at runtime.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In C following this article ( http://blogs.msdn.com/oldnewthing/archive/2006/12/21/1340571.aspx ), we have succesfully been able to
I am trying to create a custom datasource control. I have been following this
I have been learning RESTful webservices following this tutorial http://www.vogella.de/articles/REST/article.html . As I understand,
I have been playing with the demo code from this msdn article by Jeffrey
I have been told be a couple of tools that the following code is
I have been following this useful-looking article http://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/ . Unfortunately he doesn't hint at
I have been following some MVC tutorials that connect to a sql mdf database
I'm new to NHibernate... I have been following this NHibernate Tutorial from Gabriel Schenker
I have been trying to replicate the buffer overflow example3 from this article aleph
I have the following php code, which has been snipped for brevity. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.