I was encountering what appeared to be strange behaviour with the build script and running of tests in one of my BizTalk solutions. In the build script i create 3 virtual directories, 1 which hosts the web services i will publish from BizTalk and 2 which will host stubs of external applications. The build script will delete them if they already exist and then recreate them from scratch.
The build will then generate the web services which are to be published by BizTalk, and finally will run BizUnit tests to test my processes.
Previously this had all been working fine, but now i had started getting errors when calling the BizTalk web services.
I worked out that anonymous access was not enabled on the BizTalk web services but was on the stubs. Initially i was surprised as all virtual directories were created by using a taskj in the Microsoft.Sdc msbuild tasks.
After taking a break and giving myself a minute to think about this i realised the obvious, there is a setting when publishing the BizTalk web services which will amend this "allow anonymous access" setting in the virtual directory. In the xml describing how to generate the web services (look in the temp folder for a file called WebServiceDescription.xml) there is an attribute called "AuthAnonymous". This was set incorrectly because when i initially generated the services i had been careless and set this to the wrong value.
Lesson learnt, until next time!