Normally when you add a new assembly you have to go into Visual Studio and add a reference (the .dll is stored in the /bin directory).
Since this website compiles on the fly, is it possible for me to just add the .dll to the live website, and then use that .dll in an .aspx page?
Currently in Visual Studio I can't see the .dll unless I go to 'add reference'.
You can also right-click the project node and select Add > Project Reference. If you see a References node in Solution Explorer, you can use the right-click context menu to choose Add Reference. Or, right-click the project node and select Add > Reference.
To add a Web reference to a project. In Solution Explorer, right-click the name of the project to add the Web service to and then click Add Web Reference. The Add Web Reference dialog box is displayed. In the URL box, enter the URL of the Web service to use.
To add a Web Reference In the URL box of the Add Web Reference dialog box, type the URL to obtain the service description of the Excel Web Services, such as http://<server>/<customsite>/_vti_bin/excelservice.asmx or http://<server>/_vti_bin/excelservice.asmx .
You can indeed reference an assembly without going through Visual Studio. Steps:
<%@ Assembly Src="pathToDll" %>
or <%@ Assembly Name="assemblyName" %>
to the top of your ASPX page.<%@ Import Namespace="Foo.Bar" %>
at the top of the page.Then reference away!
Adding the reference in Visual Studio is only for compile-time support. Any static references to types in your non-ASPX code (e.g. codebehinds) must be resolved by the compiler, so all DLLs obviously need to be present. Since ASPXs are usually compiled on the server at request time, as long as the referenced DLLs are available then, everything will come together.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With