Web Config conflict?

A

Alberto

I have 2 ASP.NET (C#) applications (A and B) running on the same
server (IIS6, but the problems is also present in IIS5).

Each application has its own Web.Config file. The only difference
between the web config files is the following

<system.web>
<httpHandlers>
<add verb="GET" path="cachedimageservice.axd"
type="MsdnMag.CachedImageService,DynamicImage" />
</httpHandlers>
</system.web>

When I run application A, which does not contain the above handler, I
get an error: "File or assembly name DynamicImage, or one of its
dependencies, was not found."

It is as if the handler declaration is machine wide and not limited to
application B. What is going on?

Finally, if I add the DynamicImage.dll to application A's bin
directory the error goes away... Application A does NOT make use of
this dll

Any clues?
 
B

bruce barker

application a must have a reference to the dll. when the page is compiled
(first hit) the compiler will need the dll to complete the compile.

-- bruce (sqlwork.com)


| I have 2 ASP.NET (C#) applications (A and B) running on the same
| server (IIS6, but the problems is also present in IIS5).
|
| Each application has its own Web.Config file. The only difference
| between the web config files is the following
|
| <system.web>
| <httpHandlers>
| <add verb="GET" path="cachedimageservice.axd"
| type="MsdnMag.CachedImageService,DynamicImage" />
| </httpHandlers>
| </system.web>
|
| When I run application A, which does not contain the above handler, I
| get an error: "File or assembly name DynamicImage, or one of its
| dependencies, was not found."
|
| It is as if the handler declaration is machine wide and not limited to
| application B. What is going on?
|
| Finally, if I add the DynamicImage.dll to application A's bin
| directory the error goes away... Application A does NOT make use of
| this dll
|
| Any clues?
 
J

Juan T. Llibre [MVP]

Check to see if Application A's directory is declared,
in IIS, as an IIS Virtual Directory or as an IIS Application.

Also, if you could post what the physical
directory structure looks like, it would help
pin down the problem.

Is it:

/root/A/B

or
/root/B/A

or
/root
/A
/B

i.e., is either B or A a subdirectory of the other one,
or are both subdirectories of the root directory ?



Juan T. Llibre
===========
 
J

John Saunders

Alberto said:
I have 2 ASP.NET (C#) applications (A and B) running on the same
server (IIS6, but the problems is also present in IIS5).

Each application has its own Web.Config file. The only difference
between the web config files is the following

<system.web>
<httpHandlers>
<add verb="GET" path="cachedimageservice.axd"
type="MsdnMag.CachedImageService,DynamicImage" />
</httpHandlers>
</system.web>

When I run application A, which does not contain the above handler, I
get an error: "File or assembly name DynamicImage, or one of its
dependencies, was not found."

It is as if the handler declaration is machine wide and not limited to
application B. What is going on?

Finally, if I add the DynamicImage.dll to application A's bin
directory the error goes away... Application A does NOT make use of
this dll

Any clues?
 
J

John Saunders

Alberto said:
I have 2 ASP.NET (C#) applications (A and B) running on the same
server (IIS6, but the problems is also present in IIS5).

Each application has its own Web.Config file. The only difference
between the web config files is the following

<system.web>
<httpHandlers>
<add verb="GET" path="cachedimageservice.axd"
type="MsdnMag.CachedImageService,DynamicImage" />
</httpHandlers>
</system.web>

When I run application A, which does not contain the above handler, I
get an error: "File or assembly name DynamicImage, or one of its
dependencies, was not found."

It is as if the handler declaration is machine wide and not limited to
application B. What is going on?

Finally, if I add the DynamicImage.dll to application A's bin
directory the error goes away... Application A does NOT make use of
this dll

Any clues?

Is Application A under application B virtually? If so, then this is a known
bug, and you've already found the workaround - put the DLL into the bin
folder of application A. You can then use <remove> in the application A
web.config to get rid of the handler.


John Saunders
 
A

Alberto

Thanks for your replies, but I think I am still really puzzled.
The structure of the dir is

/root
/A
/B

and neither A not B are virtual directories. So how can this happen?
 
J

John Saunders

Alberto said:
Thanks for your replies, but I think I am still really puzzled.
The structure of the dir is

/root
/A
/B

and neither A not B are virtual directories. So how can this happen?

I'm not sure I understand your structure. Are you saying that you've got,
say: http://site/ then http://site/A/ and http://site/B/ ? If so, then the
scenario I described should only happen if the web.config in the root had
the HttpHandler in it.

John Saunders
 
J

Juan T. Llibre [MVP]

What's happening is that neither of your
config files in A *or* B are executing.

If you make A an IIS virtual directory,
the web.config in /A will execute.

If you make B an IIS virtual directory,
the web.config in /B will execute.

Right now, both A and B are running either off of the
web.config in /root, if there is one, or off of machine.config.

Try either...and let us know.



Juan T. Llibre
===========
 
A

Alberto

I think I have solved the problem...

As I mentioned I had 2 applications A and B. However, application A
was the default application when you reached http://site -->
http://site/A. Application B was reachable from a link in application
A or from http://B

Looking at IIS Manager at http://site one sees A and B as a virtual
directory under it... so apparently I was wrong!

In any case, I did the following which solved the problem.
I added a file default.aspx at http://site which contains a simple
<%Response.Redirect("A")%>. Each application then has its own
webconfig file.

Is this the best way to do this?

Thanks
Alberto
 
Joined
Nov 9, 2006
Messages
1
Reaction score
0
I have a very similar problem and would like to see your solution. My root application works fine. The application in the sub folder fails. If I remove the web.config file in the root, the application in the sub folder now works fine, it has it's own web.config file. Since your redirection seems to have worked for you, I would like to get the complete details. So far I haven't been able to get rid of the conflict between web.config files.
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top