I created a VB.NET Class, and created a strong key, and added it to the GAC using the GacUtil. That part has gone smoothly. The Assembly is installed in the GAC and seems to be installed/configured correctly.
FYI, the assembly is a Class called Tester, that exposes one public static method called HelloWorld, which returns a string, "Hello World".
The next step was to create a test web application (VB.NET and ASP.NET 2.0), using Visual Studio 2005, Windows XP SP3. I created the test web application and added the following to the web.config file's configuration section.
<assemblies>
<add assembly="BenGACTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3e5b6cecb56999ca" />
</assemblies>
I then added some inline code to my aspx page as follows:
<div><%=BenGACTest.Tester.HelloWorld()%></div>
When I run the page in the web browser, indeed everything works as expected. The page outputs "Hello World" and all seems good.
However, I don't know how to use this code in the code-behind page. I try to import the assembly, just like "imports system" and it doesn't appear in the IntelliSense.
Also, when I try to add the assembly as a reference to the project, the assembly is not found in the list of installed assemblies. I believe this is because the list is pulled from the registry, not from a dynamic list of installed assemblies.
My goal is to add the assembly via the web.config file, not by adding it as a project reference, and to use the assembly in the code-behind page.
Any ideas?