Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLSystem.IO.IOExceptionSystem.IO.IOException
Previous
 
Next
New Post
8/20/2008 12:03 AM
 

I have written an application that modifies an XML file containing the data required for my transformation. Everything works great in my development environment, but in production (godaddy.com), I get the follow error...

Error: System.IO.IOException: The process cannot access the file 'd:\hosting\gkuhn2\home\Portals\0\UpdatablePages\updatable_pages.xml' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.Delete(String path) at IMG_updatepages.PublishNewXml(XmlDocument& xdocNew, String root)

Here is the chain of events that leads to the error:

  1. Create, modifiy and save an XML file using XMLDocument
  2. View a page that consumes the XML using the XML Module
  3. Execute the create, modify, save process again. This time the error is thrown.
  4. If I restart the application via the Host properties menu and repeat from step 1, the exact same thing happens.

So far I know the following.

A. It only happens in production

B. The XmlReader returned by the XmlSource property of the XmlController class does not seem to dispose of the XmlReader properly. I am wondering if this might be the cause, eventhough it only happends in production.

 

Thanks in advance.

 

Does anyone have any insite into this problem?

 
New Post
8/21/2008 5:04 PM
 

MachDev, Iam not aware of that issue. I am not working with XML files in production for myself, always against URLs.

However, if you are right, open APP_CODE/XML/components/XmlController.vb with an editor (Notepad is fine) and replace the Render Section with this code:

#Region "| Rendering |"

        ''' 
        ''' Returns the result of the XSL Transformation into a TextWriter. 
        ''' 
        Public Sub Render(ByVal output As TextWriter)
            Dim Xslt As XslCompiledTransform = GetXslTransform()
            Using Xml As XmlReader = XmlSource
                If Not Xslt Is Nothing And Not Xml Is Nothing Then
                    Xslt.Transform(Xml, TransformArgumentList, output)
                End If
            End Using
        End Sub

        ''' 
        ''' Returns the result of the XSL transformation into a Stream
        ''' 
        Public Sub Render(ByVal stream As System.IO.Stream)
            Dim Xslt As XslCompiledTransform = GetXslTransform()
            Using Xml As XmlReader = XmlSource
                If Not Xslt Is Nothing And Not Xml Is Nothing Then
                    Xslt.Transform(XmlSource, TransformArgumentList, stream)
                End If
            End Using
        End Sub
#End Region
 
New Post
8/22/2008 3:00 AM
 

That did the trick. I was going to try exactly that, but I didn't want to start chasing my own tail on this one.  Figured you might have heard of this one before, so I took a shot at a forum post.

I am guessing that in development my IIS worker process was set to recycle more frequently then on godaddy.com.  Thus, the appearence that it was working properly in development.

Thanks for your help.

Regards,

Jeff Gochin

www.keystonecomputer.biz

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLSystem.IO.IOExceptionSystem.IO.IOException


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out