views:

145

answers:

3

Hi,

In my web application (Dotnetnuke 5) site, for development purposes I made a virtual directory under the main website.

As a result, in my solution I have the main Web site as well as the virtual directory website which is actually a folder inside this main web site.

Now I want to have this as a virtual directory because I want to focus differently on this virtual directory project. However, my problem is the following.

---REAL PROBLEM HERE--- When I try to compile this virtual directory for any reason, it places a web.config in this VD which screws my system.

---Questions 1. How can I prevent VS to automatically place web.config here? 2. Or alternatively how can I make this web.config completely ignorant or in other works let it have 0 effect some how?

+3  A: 

Do you have NAnt installed and knowledge of MSBuild? You could use MSBuild to compile your project, and then use an NAnt script to perform any post build operations (such as deleting your stray web.config file, or updating connection strings for a particular environment etc.)

Astrofaes
I agree that playing with MSBuild may help me over here. But for WSP (Website project) where is the proj file? Don't have any.
SevDer
If I had the proj file, I would be adding (simply) post build event to clean it up but simply functionality is not there. I hope I am wrong.
SevDer
+2  A: 

What type of Visual Studio project is it that is located within the virtual directory? My thought is that you're using a Web Site Project (WSP), which would be more likely to auto-generate a web.config file.

I know from experience that compiling a Web Application Project (WAP) does not automatically create a web.config (although certain actions still will, like adding a new web service to your project). Perhaps you can look into using a WAP.

Ian Robinson
I don't want to make it WAP. I know that but WSP is the way to go for me.
SevDer
+1  A: 

Are you sure it's Visual Studio that's adding the web.config? I know that IIS will add a web.config if you make customizations to the web site/application. I'm not sure if this is the case with virtual directories, though.

100% sure that it is adding at compile time as this is messing up my site. Currently I delete it manually to fix the issue.
SevDer