I cannot tell you which code might be consuming the resource file. But, however, you can use this method to close the resource.
resource.Close();
Mostly, streams show this kind of behaviour and you can close them once you're done working.
Recommendation
I would like to recommend you that you should use the
using
block while working with the resource. This ensures the correct disposal or resources, or to be technically speaking, IDisposable objects. For more, please read this document.
http://msdn.microsoft.com/en-us/library/yh598w02.aspx[
^]