Can't load 'namespace.type'. File or executable not found?

A

Andy B

I have 2 web applications: ParentApp and ChildApp. The ChildApp root folder
is setup like this: ParentApp/ChildApp. I set the output folder of the
ChildApp under the build section in VS2005 properties for the project to the
ParentApp/bin folder. Everything builds ok, but when I run a page in the
ChildApp, I get something like: Can't load 'namespace.type'. The file
ChildApp could not be found. Is there any way to fix something like this?
 
B

bruce barker

asp.net applications only look in /bin and the windows folder for dlls.
change the build to output to the correct bin

if the parent needs a reference to the child, then add a ref, which will
copy the child bin to the parent bin.

-- bruce (sqlwork.com)
 
P

Patrice

Looks expected to me. The destination for the compiled code for ChildApp is
the parent bin folder... So when you run the ChildApp, it can't find its own
code as this is located somewhere else than in its own bin folder...

Though you could change the web.config file to change the default bin
folders or just let the ChildApp code goes in the ChildApp bin folder, your
best bet could be to explain what you are trying to do in case someone would
have a better way to achieve your goal (or are you trying to create a class
library ??)
 
A

Andy B

I am trying to put all of the dll/code files in the "whole" application in
the parent bin folder because it would reduce the size of the application by
not having bin folders for each application. The other thing is, if I have
ChildApp.dll in ChildApp/bin, but ParentApp needs to make a reference to it,
the whole application now has 2 copies of ChildApp.dll in it (this is what I
am trying to avoid for the most part). Any ideas how to do this? I would
rather not use the GAC since I have no access to it on the live server.
 
P

Patrice

And the size of this file ?

Try :
http://www.codinghorror.com/blog/archives/000131.html
The probing tag should allow to specify another directory in whihc case you
could perhaps left the dll file at its place and just ask the parent
application to saerach also the other bin folder for assemblies.

My personal preference would be likely rather to create a class library that
would contain ony the common code reducing the file size and having them at
both places.

Another option if those two sites are closely linked one with the other
would be to handle them as a single site with two "subsites"...
 

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,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top