adding .net code to a classic asp website, can't reference namespaces in .dll file
Asked Answered
D

2

1

I have an existing fairly large classic asp website, with virtual directories configured to centralize certain resources. My problem is for some reason I can't access any of my namespaces and classes. I tried adding a reference to another project where I have classes in a namespace "DAL" and even though intellisense sees the classes and the website compiles fine, it errors when I try to access any page that references a class in the "DAL" namespace.

I get the following error message in my browser "CS0103: The name 'CMS' does not exist in the current context". Part of the problem is website project's root is not the same folder/level as the web root in IIS. So my libraries are in the website root "/bin" folder, but iis is looking for these files in the IIS webroot which is at a lower level. So how can I get .net to see my binaries without putting them in the lower IIS website root directory? I tried setting up a virtual directory to my .dll file but it seems to have no effect.

thank you for your help!

======================CLARIFICATION====================



What I'm trying to do is keep the .dll files I want my website to use in a higher level directory then the folder I have set as the web root in IIS. So say the library i want to use it "DAL" it in the projects /bin folder, but under IIS the default site's Local Path is set to "/site/default". The only way I can seem to use the "DAL" library is by putting the /bin folder into "/site/default/bin", which for this project is not an option. Does this help?

Dynamometer answered 17/12, 2008 at 20:20 Comment(3)
You do have the site set up in IIS as a .Net site now right?Absher
yes its setup to use .net 2.0 under IISDynamometer
Answer given in: https://mcmap.net/q/1634393/-asp-net-website-external-bin-folder-duplicateAbsher
I
1

Using an NTFS Junction Point to achieve what sounds like the same goal has been working for me.

By way of an example, I have a web site with 20+ child IIS Applications that are largely identical (don't ask!), rather than duplicating the 'bin' folder in each of these (they would be identical) each child application has a 'bin' junction that points to the 'bin' folder in the web site root.

/bin           <- this is the actual 'bin' folder
/app1
/app1/bin      <- this is a junction point
/app2
/app2/bin      <- this is a junction point
/app3
/app3/bin      <- this is a junction point
/images
...
...

To create these junction points, if you're using Vista/Win2k8 or later you can use the built-in command 'mklink', for earlier versions of Windows use the SysInternals junction.exe tool - available here.

Iow answered 18/11, 2011 at 16:8 Comment(0)
I
0

Maybe make the website route folder a nested application in IIS?

Infecund answered 17/12, 2008 at 20:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.