Use Web Reference Dll in Code Behind without a project file
-
I am working on a web site where I can only upload/download files using FTP. I don't have access to create a project on the server directly with VS.Net. I have a web service dll which I created on my local computer. I can access the dll with inline aspx code but I can't do the same from the code behind. Like I said, I can't create a project file on the server so I can't "add reference" like I do with VS.net on my development server. Is there anyway I can access the dll without a project file? It'd be even better if I could do a "add web reference" without a project file.
-
I am working on a web site where I can only upload/download files using FTP. I don't have access to create a project on the server directly with VS.Net. I have a web service dll which I created on my local computer. I can access the dll with inline aspx code but I can't do the same from the code behind. Like I said, I can't create a project file on the server so I can't "add reference" like I do with VS.net on my development server. Is there anyway I can access the dll without a project file? It'd be even better if I could do a "add web reference" without a project file.
Like all assemblies which would be added using Add Reference, drop it in your web application's bin subdirectory and you can use it from any code, be it inline with the page or code-behind. Keep in mind that in either case the code is treated the same except code-behind source must be pre-compiled into an assembly for the web application while inline code is compiled upon the first access of the page after the app has been (re)started or the cache temporary page cache cleared. When you compile your code-behind be sure to add a reference (/r switch). If you can't, keep using inline code. Either way, the web reference assembly goes in bin.
Microsoft MVP, Visual C# My Articles