views:

561

answers:

2

I have created a Visual Studio 2008 sp1 test suite web test that uploads a document to a document library in SharePoint. The test is a lot like the one described here.

All is fine until the test is converted to a coded web test. Then the upload post returns the response

"Request failed: Connot close stream until all bytes are written"

Any ideas on how to get it going?

A: 

...so it turns out that while the files name was included in the test as a deployment item and the file was added to the visual studio project, the visual studio file property "Copy to Output Directory" was set as "Do not copy". Changing this to "Copy always" fixes the issue.

Nat
+1  A: 

You can also use the Deployment settings in the testrunconfig. It's more sophisticated.

Tita