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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0FileManager WebService - Help NeededFileManager WebService - Help Needed
Previous
 
Next
New Post
10/17/2007 4:36 PM
 

Hello,

I am a member of the IWeb project team (http://iweb.adefwebserver.com/) that is currently working on a new version of the IWeb module that will include basic file management via a web service. I am having a file locking issue that I need some additional eyes and/or ideas to overcome. I have posted a more detailed description of the problem and attempted fixes here: http://dnnsilverlight.adefwebserver.com/Forums/tabid/62/forumid/2/postid/19/view/topic/Default.aspx

If anyone can offer any suggestions or assistance I would be most thankful! We are trying to get this out of Beta and into release in a few weeks.

TIA!

Ian

 
New Post
10/17/2007 4:40 PM
 

Ian,

I can't download the file here at work to look at the code, can you post the "save" code for the file.

Are you sure that the objects writing the file to disk are properly disposed of?  It sounds like a lingering object reference from an unclosed streamwriter.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
10/17/2007 5:26 PM
 

I am about to leave work and do not have time to post the code right now. I will however post it ASAP this evening. As for disposing the IO objects, I am 99.9% sure that I have done so. I listed some things I have tried at the link provided in my first post. To sum it up, I originally used the FileSystemUtil class in the core to do the upload. I have since refactored it to use straight System.IO objects. During the refactor, I used the "using" syntax for the Stream object and explicitly called Close before the End Using... I am not saying  I didnt miss anything (exactlly why I am calling for help), but I have done may IO processes since starting my .Net development career and typically am pretty good about proper object disposal... again not saying that, this is not the case though. It is easy to overlook the simple things when you ahve been staring at the bug long enough ;)

Thanks for your quick response! I will post the code tonight.

 
New Post
10/17/2007 9:35 PM
 

Here is the internal method that is called when a file is uploaded:


        Private Sub SaveFile(ByVal filePath As String, ByVal bits() As Byte)

            If bits Is Nothing Then Return

            Using stream As IO.FileStream = IO.File.Create(filePath, bits.Length)

                Try

                    stream.Write(bits, 0, bits.Length)

                Catch ex As Exception

                    Throw

                Finally

                    stream.Close()

                    bits = Nothing

                End Try

            End Using

        End Sub

 

Be warned, this is not the code you will find in the download but is my latest attempt to resolve this bug. The code in the download should simply call the FileSystemUtils class and is basically a wrap exposed as a web method. However I get the same result with either code...

 

 
New Post
10/18/2007 2:38 PM
 

Wow, that is odd, your code does appear to be 100% correct.  I guess I am not sure...


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0FileManager WebService - Help NeededFileManager WebService - Help Needed


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