troubleshooting Question

Locating App_Data in web apps

Avatar of ScottMacMaster
ScottMacMaster asked on
ASP.NET
7 Comments1 Solution1003 ViewsLast Modified:
I recently switched to using the new Visual Studio 2010 for developing apps.  Things mostly went smoothly.  However, there's one issue I haven't be able to resolve.

In the past, Visual Studio put the App_Data in the root of the web app directory structure (matching the project layout).  However, Visual Studio 2010 moves it under the bin directory when I publish the web app.  So my code that references files in App_Data that works fine in testing is suddenly broken when I publish the web app.  To deal with this I've just been copying App_Data to the root and avoid using the 'delete files before publish' option when I don't need to (so I don't have to copy App_Data everytime a publish a web app).

So my questions, is there a way to define a path that works in both development and live environments?  Or is there a way to tell Visual Studio to publish App_Data to the root?  Or should I be doing something different?


Thanks,
ASKER CERTIFIED SOLUTION
Ted Bouskill
Senior Software Developer
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros