Yesterday i was programming a new functionality.
I wanted to open a (word) document in code and in code write it to a different location.
During this process some data and information would be added to the file.
While debugging, everything was working like a charm.
But at runtime (without debugging) i got this odd error :The path specified is being used in a substitute.
How is this possible. It worked while debugging, but without debugging not. ODD
SO, i did what any developer would do: google the error. And this brought me to this site : Chandru’s Sharepoint / MCMS Blog.
He had the same problem. Seems that the way you call openbinary is causing the problem.
If you use the guid to open the file, you need to add a line (something like string s = file.Name) which in turn makes sure the openbinary works. Somehow when using the guid, the URL of the file is not created. If you question a property (like Name), the URL will be created.
When using the URL of the filename for opening the file, you won’t get this error.
This information solved my problem
Goto chandru’s site for more information about this error.
Eric
[...] Openbinary() odd behaviour (sharepoint developer resources)Yesterday I was programming a new functionality. I wanted to open a (word) document in code and in code write it to a different location. During this process some data and information would be added to the file. While debugging, everything was working like a charm. But at runtime (without debugging) I got this odd error :The path specified is being used in a substitute. [...]