We help IT Professionals succeed at work.

asp.ne error, "reference required to assembly"

jordanking
jordanking asked
on
Hello,

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=2.0.5.0, 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)
                atomFormatter.WriteTo(feedWriter)
            ElseIf bRssOut Then
                Dim rssFormatter As New Rss20FeedFormatter(myFeed)
                rssFormatter.WriteTo(feedWriter)
            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
version:                   2.0.0.0
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

thanks


Comment
Watch Question

Miguel OzSenior Software Engineer
Top Expert 2009

Commented:
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

Author

Commented:
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

Commented:
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
xml-ref.jpg
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.

Author

Commented:
i figured it out