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

  • SEARCH
  • Home
  • 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 4016438
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:44:23+00:00 2026-05-20T09:44:23+00:00

As the title suggests, I am getting a FileNotFoundException when running a web page

  • 0

As the title suggests, I am getting a FileNotFoundException when running a web page (ASP.NET MVC 2 project) that references a Silverlight class library. When a method on one of the classes from the Silverlight library is called, I get the following error:

Could not load file or assembly ‘System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

Ok, so a bit of an explanation about my setup. I have three projects; one is a Silverlight class library (using Silverlight 4) and the others are an ASP.NET MVC 2 web project, and a Silverlight project that has a Silverlight control that is hosted in the web project. I have referenced the Silverlight library in the web project and the Silverlight project (the one with the control). Within the SL control, I instantiate a class from the SL library, and call one of the class’s methods. That method contains calls to the System.Xml.Linq library classes. The FileNotFoundException occurs when calling that method, but not when instantiating the class.

Due to the nature of this project, I am unable to enclose any of the code I am using, but here is some arbitrary code to help illustrate the above explanation:

Class in Silverlight library

public class XmlClass
{
    public void Execute()
    {
        // Calls to System.Xml.Linq classes
    }
}

Silverlight control

public class SLControl : UserControl
{
    // ...

    private void SomeObject_SomeEvent(object sender, EventArgs e)
    {
        // Instantiate class
        XmlClass xmlClass = new XmlClass();

        // Execute
        xmlClass.Execute();           // <-- Error occurs here.
    }
}

Now the even weirder thing is; I had this error at another point in the project. In this other point, I had a standard .NET class library referencing the SL library and using the same calls as the SL control. I hit the error in the same place, and worked out that when the code was run, it was trying to look in the GAC for the relevant System.Xml.Linq assembly. As such, I installed it into the GAC and this fixed my issue.

So, I’m a little bit lost now, since the assembly is still in the GAC and the project that originally had the issue still works.

Any ideas on this?

  • 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-20T09:44:24+00:00Added an answer on May 20, 2026 at 9:44 am

    Thanks to the post by Mehmet Aras, I have managed to work out a solution to my issue.

    Basically, the issue seems to have arisen as a result of the referenced System.Xml.Linq assembly being different for both the Silverlight control and Silverlight class libraries. When the Silverlight projects were created, they contained a reference to the assembly that was found in the “C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\”. However, some when during the changing around of the references to fix the issue originally, I ended up referencing the same assembly but found in “C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\”. When I did this again for the project in error, it solved the issue.

    So from that, I’m assuming that I had actually just referenced different assemblies. This has also lead me to believe that the assembly that is referenced when the project is created, is not the right one to use.

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

Sidebar

Related Questions

I am trying to do as the title suggests, however I am getting confused.
Can anyone suggest a way of getting version information into a Web Service? (VB.NET)
As the title suggests. Any idea how to accomplish that? Been looking at http://www.html5archive.com/2010/12/04/geolocation-api-example-distance-tracking/
As the title suggests, is it correct or valid to import/export static data from
As the title suggests, I am having trouble maintaining my code on postback. I
As the title suggests. I want to be able to change the label of
As the title suggests, I'm using Google App Engine and Django. I have quite
As the title suggest... How can I apply a scrum process to anything that
As the title suggests, I'm working on a site written in python and it
As the title suggests, I would like to close a Visual Studio tool window

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.