Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP Web Config Files are killing me.

Status
Not open for further replies.

crystalized

Programmer
Jul 10, 2000
390
CA
Hey all,

Everything about web config files that I have read or seen indicate that you can have multiple web.config files (in different directories). For example in the duwamish sample they have an extensive web.config in the web app root then in the secure directory they have a web config file with very little code other than an authorization section.

Now the problem for me is that if I add a second web config into another directory in my project nothing works. I get errors on everything, I remove the second web config file and everything goes back to running flawlessly (well as flawlessly as it was running before anyway).

Has anyone else had issues with web config and if so what was your resolution? Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Hey,

Not sure if this helps but on one site I have I've done the same with a mainly open site and one secure directory by using a web.config with just:

<authorization>
<deny users=&quot;?&quot; />
</authorization>

From memory I think I had some errors but then set it up so it is not a virtual directory just a phisical directory in the root application.

Something to try...

hads.
 
I have tried that. Actually I have tried it numerous times. But without fail every time I add in a web config file in the directory I want to secure, I end up with errors.

As soon as I delete the second web config file the errors disappear. I am very frustrated with this problem. I am wondering if there is some kind of problem with the way I have the main config file set up. Although I do not know why it woud be a problem as I have looked at comparable ones and did not see any significant difference.

Any additional assistance would be appreciated. Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Well I have resolved the problem. It was not with the web config (at least not solely). My virtual directory was still not resolving properly so I disposed of it. The problems still did not completely go away, but then I remembered reading something about codebehind and src conflicting when working through visual studio and compiling the project. So I copied my files into a new location, edited them as required but did not add them to my solution. Now the error I was recieving about having multiple instances of the assembly went away.

Code:
Compiler Error Message: CS1595: 'namespaceName.frmDefault' is defined in multiple places; using definition from 'C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\projectname\94ec64d9\9ceac4e0\tduos5qp.dll'

Source Error:

 

Line 27:     
Line 28:     [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
Line 29:     public class default_aspx : namespaceName.frmDefault, System.Web.SessionState.IRequiresSessionState {
Line 30:         
Line 31:

However I would point out that it still strikes me as odd that when I was hitting the page that is part of my solution I would get the error when I had the second web config file. When I removed the second web config file without changing the other file in question I did not get the error.

The error also resolves when I change src= to codebehind=.


AHHHHHHHH isn't the learning process wonderful Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top