Why doesn't mywebsite.dll.config get included in my cspkg?

465 views Asked by At

I have an azure web role with Azure SDK 2.3. My web site project website has web.config, which gets copied to bin/debug/website.dll.config properly during build. But Azure SDK totally fails to include this DLL in the cspkg which causes my role OnStart to fail, since it depends on binding redirects in the web.config to load the correct version of the Azure runtime assemblies. Anyone got any bright idea why cspack isn't including this file and what to do about it?

1

There are 1 answers

6
astaykov On

web.config files are never copied as projectNAme.dll.config!

Only application.config files are copied this way. And yes, for Web Roles nothing beside the regular web.config are automatically copied.

You have to name your configuration file following the name of your main application assembly (i.e. website.dll.config) and then explicitly mark it with Copy Always in the properties panel, section Copy to output folder. Thus the file will be included into the web role package.