473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Somewhere besides "bin" directory to put managed dlls?


New to ASP.Net over here, so apologies if this is a basic question-- I'm
using VB .Net to build a managed dll, which I then use in some aspx files.

Works fine, except every time I recompile I have to copy the dll into the
"bin" directory off my root web, otherwise ASP.Net won't find it. I've
added my components the GAC (using gacutil), but that didn't seem to make a
difference-- "bin" or bust, I'm getting.

How can I use my dll without having to copy it to the bin directory every
time I change it? Thanks for the clarifications.

Nov 18 '05 #1
5 1860
The GAC shoudl work just fine. If this isn't working, it is probably because
the version of the DLL in the GAC, is not the same as the version of the DLL
your asp.net classes were compiled with.

"Jim Bancroft" <bo********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

New to ASP.Net over here, so apologies if this is a basic question-- I'm
using VB .Net to build a managed dll, which I then use in some aspx files.

Works fine, except every time I recompile I have to copy the dll into the
"bin" directory off my root web, otherwise ASP.Net won't find it. I've
added my components the GAC (using gacutil), but that didn't seem to make a difference-- "bin" or bust, I'm getting.

How can I use my dll without having to copy it to the bin directory every
time I change it? Thanks for the clarifications.

Nov 18 '05 #2
You can right click on the project in the IDE, choose properties>>
configuration settings>> build, and tell .net where to compile your .dll to

"Jim Bancroft" <bo********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

New to ASP.Net over here, so apologies if this is a basic question-- I'm
using VB .Net to build a managed dll, which I then use in some aspx files.

Works fine, except every time I recompile I have to copy the dll into the
"bin" directory off my root web, otherwise ASP.Net won't find it. I've
added my components the GAC (using gacutil), but that didn't seem to make a difference-- "bin" or bust, I'm getting.

How can I use my dll without having to copy it to the bin directory every
time I change it? Thanks for the clarifications.

Nov 18 '05 #3
Are you dynamically loading the assembly? I'm guessing that this is the case
because if your Web Application had a reference to it it would be coppied
automatically.

Please tell us more about how you reference/load the assembly.

"Jim Bancroft" wrote:

New to ASP.Net over here, so apologies if this is a basic question-- I'm
using VB .Net to build a managed dll, which I then use in some aspx files.

Works fine, except every time I recompile I have to copy the dll into the
"bin" directory off my root web, otherwise ASP.Net won't find it. I've
added my components the GAC (using gacutil), but that didn't seem to make a
difference-- "bin" or bust, I'm getting.

How can I use my dll without having to copy it to the bin directory every
time I change it? Thanks for the clarifications.

Nov 18 '05 #4
First, thanks for your help. Same goes for the other posters above.

As to your question...you want to know how I load the assembly? Well, my
aspx file reads like this at the top. It's a throwaway page, nothing fancy:

<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace = "ClassLibrary1.TransactionTest001"%>

<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
HelloWorld.Text = "Hello World!"
End Sub
</script>

<html>
<head>
<title>ASP.NET Hello World</title>
</head>
<body bgcolor="#FFFFFF">

<p><asp:label id="HelloWorld" runat="server" /></p>
<%
Dim testobject as Test1
testobject = new Test1
testobject .SomeTestMethod()
%>

Just importing my namespace and creating the object using New(). My page
doesn't use any web.config files, nothing besides what you see here.

-Jim

"Brad Quinn" <Br*******@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Are you dynamically loading the assembly? I'm guessing that this is the case because if your Web Application had a reference to it it would be coppied
automatically.

Please tell us more about how you reference/load the assembly.

"Jim Bancroft" wrote:

New to ASP.Net over here, so apologies if this is a basic question-- I'm
using VB .Net to build a managed dll, which I then use in some aspx files.
Works fine, except every time I recompile I have to copy the dll into the "bin" directory off my root web, otherwise ASP.Net won't find it. I've
added my components the GAC (using gacutil), but that didn't seem to make a difference-- "bin" or bust, I'm getting.

How can I use my dll without having to copy it to the bin directory every time I change it? Thanks for the clarifications.

Nov 18 '05 #5
If I'm not mistaken (and I may be) the @ Import directive is equivalent to a
"using" directive, it doesn't actually cause the assembly to be referenced.

When I build an assembly that I'm going to install in the GAC I have a post
build step that's something like this:

echo Installing assemblies in the Global Assembly Cache
path=%path%;"C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\"
for %%a in ($(TargetDir)*.dll) do gacutil /i "%%a" /f
echo Windows Registry Editor Version 5.00>$(ProjectName).reg
echo
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramewor k\AssemblyFolders\$(ProjectName)]>>$(ProjectName).reg
set td=$(TargetDir)
echo @="%td:\=\\%">>$(ProjectName).reg
regedit /s $(ProjectName).reg

This causes the assembly to appear in the .NET tab of the "Add Reference"
dialog.

If you add a reference to your assembly from your web application, I think
that you'll find that the web application uses the assembly in the GAC. You
wont need a copy of that assembly in the bin directory.

There may be a simpler way but this works for me.
"Jim Bancroft" wrote:
First, thanks for your help. Same goes for the other posters above.

As to your question...you want to know how I load the assembly? Well, my
aspx file reads like this at the top. It's a throwaway page, nothing fancy:

<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace = "ClassLibrary1.TransactionTest001"%>

<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
HelloWorld.Text = "Hello World!"
End Sub
</script>

<html>
<head>
<title>ASP.NET Hello World</title>
</head>
<body bgcolor="#FFFFFF">

<p><asp:label id="HelloWorld" runat="server" /></p>
<%
Dim testobject as Test1
testobject = new Test1
testobject .SomeTestMethod()
%>

Just importing my namespace and creating the object using New(). My page
doesn't use any web.config files, nothing besides what you see here.

-Jim

"Brad Quinn" <Br*******@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Are you dynamically loading the assembly? I'm guessing that this is the

case
because if your Web Application had a reference to it it would be coppied
automatically.

Please tell us more about how you reference/load the assembly.

"Jim Bancroft" wrote:

New to ASP.Net over here, so apologies if this is a basic question-- I'm
using VB .Net to build a managed dll, which I then use in some aspx files.
Works fine, except every time I recompile I have to copy the dll into the "bin" directory off my root web, otherwise ASP.Net won't find it. I've
added my components the GAC (using gacutil), but that didn't seem to make a difference-- "bin" or bust, I'm getting.

How can I use my dll without having to copy it to the bin directory every time I change it? Thanks for the clarifications.


Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Frank Meng | last post by:
Hi. I wrote a program to get the directory of "Recycle Bin" with SHGetSpecialFolderLocation . It works for "Recent", "SendTo", etc. but it doesn't work for "Recycle Bin". At...
2
by: Derrick | last post by:
and I can't delete them. If I close the project, go delete the folders manually, the items reappear in my project. Any ideas what this is from? I do not see project settings on the "auto add...
6
by: Kevin Mitchell | last post by:
I have an NT shared hosting account, but the provider names the script/write folder cgi-bin. I want to place DLLs in the cgi-bin directory and get them to work in my Web applications. What do I...
4
by: Brian Pearson | last post by:
Hi, For a web application, is it possible to use something other than the \bin directory for local assemblies? I do not wish to use the GAC. My end goal is to have multiple websites use the...
6
by: John Doe | last post by:
Hi, I've got the following error when building my ASP.NET application called WebApplication1: Preparing resources... Updating references... Performing main compilation... error CS0006:...
1
by: Sam Learner | last post by:
Hello, you guys have been very helpfull in responding to questions from the newgroup community and thank everyone for your contributions. I have a Question, I am developping a software to do clean...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
1
by: Boris | last post by:
We have some .NET 1.1 DLLs which we want to use in a ASP.NET 1.1 web page (actually one is a real .NET DLL in Managed C++ while the others are native Windows DLLs). First we copied all of the DLLs...
2
by: CGatto | last post by:
Hi, We have just started getting the following error during compiles of our forms-based application. We are developing in VS2008, VB.Net, with Team Foundation Server-based source control. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.