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 7562987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:33:00+00:00 2026-05-30T13:33:00+00:00

I have a solution First which consists of few projects. One of the projects

  • 0

I have a solution “First” which consists of few projects. One of the projects references the other projects’s dlls. I add them via browsing to a specific location.
When I start another solution “Second” with one simple windows app, I add reference to “First” and to two of “First”‘s projects, which extend one from another. I add the references via code from “First”.

Now, in “First”, I have this line of code:

OneProject hello = OneProjectList[OneProjectList.Count - 1];
StringWriter sw = new StringWriter();
XmlSerializer serializer=new XmlSerializer(hello.GetType(),new Type[]{typeof(OneProject)});
serializer.Serialize(sw, hello);

The project crashes on the last line. The exception says {“[A]Something.X cannot be cast to [B]Something.X.
Type A originates from ‘Something, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ in the context ‘LoadFrom’ at location ‘goodLocation’.
Type B originates from ‘EL_CL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ in the context ‘LoadNeither’ at location
‘C:\Users\John\AppData\Local\Microsoft\VisualStudio\8.0\ProjectAssemblies\p3www12k01\EL_CL.dll’.”}

In the Output window in VS, I have: ‘devenv.exe’ (Managed): Loaded ‘C:\Users\John\AppData\Local\Microsoft\VisualStudio\8.0\ProjectAssemblies\p3www12k01\Something.dll’, No symbols loaded.

Why is this assembly getting loaded? That line in the Output window is shown while serializer.Serialize(sw, hello);, and right after that the program crashes.

Note that Something = hello.GetType().

  • 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-30T13:33:01+00:00Added an answer on May 30, 2026 at 1:33 pm

    Does it work if you take out the extra Type array from your XmlSerializer constructor?

    XmlSerializer serializer = new XmlSerializer(hello.GetType); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Visual C++ solution, which consists out of 3 projects. One of
I have 2 projects in my solution. The first one is a console application,
I think I have a big problem. I have a two projects solution. First
I have a solution which contains six projects. Four of the projects are class
I have written an algorithm which iteratively solves the problem. The first iteration consists
I have EF Code First solution which supports soft delete so we mark entities
We have some solution that we built against a MOSS farm one of which
I have a data structure which consists of pairs of values, the first of
I have a solution file with has more than 30 projects in it. Different
I have a Solution called Framework which is a C# assembly for my business

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.