We help IT Professionals succeed at work.

asp.ne error, "reference required to assembly"

jordanking asked

I have an aspx page that is going to display the rss feed content generated on the page load event from the backend sql server db.

when I try to build the project, i get the following error:
Error      1      Reference required to assembly 'System.Xml, Version=, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' containing the implemented interface 'System.Xml.Serialization.IXmlSerializable'. Add one to your project.      C:\.....\NewsRss.aspx.vb      97      42      News

on the following lines with "Atom10FeedFormatter" and "Rss20FeedFormatter" :
            Dim outputSettings As New XmlWriterSettings()
            outputSettings.Indent = True
            Dim feedWriter As XmlWriter = XmlWriter.Create(Response.OutputStream, outputSettings)

            If bAtomOut Then     
                Dim atomFormatter As New Atom10FeedFormatter(myFeed)
            ElseIf bRssOut Then
                Dim rssFormatter As New Rss20FeedFormatter(myFeed)
            End If

Open in new window

myFeed is the sydicationfeed object with the record values

My web project has a reference to:
Name:                      system.xml
location:                  C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll
runtime version:      v2.0.50727

I think this is exactly what it is looking for, i can't figure out how to resolve this required reference.  

Any help is greatly appreciated


Watch Question

Miguel OzSenior Software Engineer
Top Expert 2009

You need tto add the reference to your project folder:
1- From the project menu in your web app, select "Add Reference"
you will be prompted with the add reference dialog
2- search for System.xml and click add when finished.

the steps above will add reference to your web.config file Then you can use it in you aspx page


thanks for the reply,

My project had that reference already listed, so I deleted it and added it again exactly as you said, which unfortunately did not solve the problem
Miguel OzSenior Software Engineer
Top Expert 2009

I have just created a new web project, I have no problem refering to it.
You can create a new app, add the reference and add your page and then use a file comparison tool to check what you are missing
thanks for the effort mas oz2003

i narrowed the error down to needing a function as mentioned above, the reference for that function changed with asp.net 3.5 so I had to add a reference to the following script and it worked:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.ServiceModel.Web.dll

System.ServiceModel.Web.dll is what you need if you want to serialize an xml feed with atom or rss 2.0.  Took me a few hours to figure this out.


i figured it out