tags:

views:

1928

answers:

5

Hi

I get the following error when trying to load an RSS feed:

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

My code works fine from my local host, error only occurs when i upload it to my dedicated server!

Here is the code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim signJ As String = DropDownList1.SelectedValue

    If signJ <> "" Then
        Try
            Dim xmlDoc As XmlDocument = New XmlDocument
            Dim xdsData As XmlDataSource = New XmlDataSource
            Dim xpath_path As String = String.Empty
            Dim RSS_Feed As String = String.Empty

            xpath_path = "rss/channel/item[title='" & signJ & "']"
            RSS_Feed = "http://feedurl.."

            xmlDoc.Load(RSS_Feed)
            xdsData.Data = xmlDoc.OuterXml
            xdsData.XPath = xpath_path
            rptData.DataSource = xdsData
            rptData.DataBind()
        Catch ex As Exception
            Response.Write(ex.Message)
        End Try
    End If

End Sub

Error occurs on this line: xmlDoc.Load(RSS_Feed)

Real stuck on this one! cheers

A: 

I'm not familiar with this error but have you verified that your security/permissions are set correctly on the dedicated server?

Also you might want to confirm that you can access the feed directly from a browser on the dedicated server.

This link may be helpful.

Jonathan S.
+1  A: 

I have checked the feed from a browser on my server and it works.

Where do i start to look at the security and permission settings on the server, the web.config file?

If you aren't familiar with setting user permissions and DLL trust levels I wouldn't recommending going in and making significant changes without understanding their consequences. So without being able to see the server it's hard to say. I've updated my answer with a link that may be helpful.
Jonathan S.
A: 

Hi

thanks for your answer, i have a feeling that this security/permission problem is also linked to another error i have been getting when i try to connect to an external database:

"error 40: - could not open a connection to sql server"

It is my own personal dedicated server and i currently only have one test website running - i've looked at the link you sent but still no further. I've also been through permission settings in IIS (6.0) and still no joy!

A: 

I get the Attempted to read or write protected memory error when I install .NET 3.5 SP1 (so I can develop asp.net mvc apps).

Downgrading to .NET 3.5 without the service pack fixes the error but of course prevents me from doing mvc development. Time to dust off the virtual machine.

Todd Smith
A: 

We had the same behaviour as Todd Smith mentions. After the upgrade to .Net 3.5 SP1 we got this error.

In our case the reason was the protection / obfuscation of our DLLs with Remotesoft Protector.

This is most likely only our problem and not a solution for anyone else. Nevertheless I thought I'd mention it here cause it did cost us some hours to find out.

If you protect, obfuscate your DLLs: disabling that might be worth a try.

PeterTheNiceGuy