I have a web application project WAP that references class library CL. CL needs some xml configuration files in order to work properly.
In WAP's csproj, I add a PostBuildEvent to copy the necessary XML files to the TargetDir. When I build, the folder structure is good; the bin folder contains CL and the xml files.
When I run the webservice, CL throws an error because it can't find the xml files:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\accountreplication\284ca636\19f84c15\assembly\dl3\bf68503c\34888845_bd69cb01\XmlTemplates\Clusters.xml'.
From what I've read, ASP.NET will compile on the fly my files and put them in that 'Temporary ASP.NET' folder. So it seems like my problem is that the xml files from the /bin/ folder are not copied in that temp folder.
Any idea on what I should do to get around this? Either to copy the xml files in the temp folder, or to actually serve the files from the /bin/ directory directly (not sure if this is possible). Ideally, I don't want to add an environment variable to the /bin/ directory.
Thanks!