This project has moved and is read-only. For the latest updates, please go here.

Closed exception file when using ElevatedTrustDriver


Look at this post:

We get the same error in that post, and we changed sterling source code. please look at comments.
public BinaryWriter GetWriter(string path)
      BinaryWriter binaryWriter = null;
           binaryWriter = new BinaryWriter(File.Open(path, FileMode.Create, FileAccess.Write));
           return binaryWriter;
     catch(Exception ex)
           throw new SterlingElevatedTrustException(ex);
          /* We remove this code, I just post this issue to confirm this issue is exist, our solution is correct? please sterling team advise, thanks.
          if (binaryWriter != null)




petermorlion wrote Sep 27, 2013 at 11:47 AM

I find this strange, as I'm using SterlingDB in an application that is being actively used and don't have this problem. But I am using the IsolatedStorageDriver, and I guess you are using the ElevatedTrustDriver? The Iso driver doesn't do that, and I'm not sure why the FileSystemDriver does.

If it works for you, I'd say go with it, but you'd probably have to see that you close the writer somewhere. I currently don't have the time to invest in Sterling anymore, and the core team (I helped out) are now making Sterling v2 (on GitHub).