I'm not sure if I'm doing something wrong, but hopefully someone can help me figure it out.
I created a very simple class library project, compiled it (no problems here). I then added a reference to it from the website project. Visual Studio sees it and I can use the class in my website project. When I try viewing the website project in the browser, I get the "are you missing a using directive or an assembly reference?" error. I've placed the DLL file in the bin folder off the webroot. The weird thing is that when I enable .NET 2.0 for the site, it runs fine and does it's thing as expected.
Is there differences between .NET 1.0 and 2.0 when using DLL files? I'm using Visual Studio 2005 to create and compile the class library.
maybe u forgot the "using" directive (Import in VB)
if this post unswerd ur question marke it as answer
Somebody correct me if i'm wrong. I believe there are changes on constructing .net 2.0 class library, such as partial class. This is just a small insight, you can always go to msdn to thoroughly search on this issue.
Please don't forget to click "Answer" if it helps you as it may help others also.
Hmm... I tried searching MSDN but I'm not even sure where to start.
I'm pretty new to ASP.NET. For my client, I've been doing small things here and there using a single code behind file. But now that things are revamping up, I thought it be better to start using components to separate things. I'm coding in C#.
Maybe if will help if I post some code snippets.
This is the class file:
public class Album
public string Testing()
return "Company.Pictures.Album.Testing() called!";
This is the code behind that's calling it:
public class test3 : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
Album test = new Album();
I hate to bump this... but am I doing anything wrong in my code? I'm trying to run this in .NET 1.0. I unfortunately can't dev for .NET 2 or higher because the client does not want to update the framework. It works just fine when I'm running it in .NET 2. Am I creating the class incorrectly for .NET 1?
Thanks for any help.
Did you actually add a reference to this DLL in your project through right clicking on "references" in your Solution Explorer ----> Add Reference ---> Browse tab ---> find your dll file and press ok...
Don't forget to mark this post as "Answer" if it indeed answered.
I don't have hard evidence on this, but I don't think you can develop 1.1 on VS 2005 unless you do something really weird to your build process (read about it somewhere but I don't remember where).
VS 2005 is targetting 2.0 framework only. If you need to develop 1.1 stuffs (I am not sure about 1.0 hehehe), use VS 2003. I guess VS.NET for 1.0.
Even the new VS2008 can't target 1.x framework.
This might be the issue, but again I have no hard evidence.
You might want to download 1.0 or 1.1 SDK and compile it in consle using that. See if that work.
Blogging at Incoherent Rambling
Thanks Jimmy. I'll try that.
Hey Jimmy, thanks again for your help. I compiled the class with the 1.1 framework and it works! But I can easily see this becoming a drag to always compile in the console. Do you know if it's possible to have VS2003 and VS2005 installed side by side?
Quick question, how do I compile multiple class files? Do I just append them like: /out:compiledfile.dll class1.cs class2.cs etc..?
Update: Actually I guess I could write the compile script into a bat file.
Yes, it is possible to have all VS 2003 / VS 2005 / VS 2008 to be installed side-by-side. Although I don't think it's a good idea to do so with VS 2005 & VS 2008 (unless there is a very good reason like K2 BlackPearl which requires specific version of VS) since VS 2008 can target 2.0 framework. It will just be redundant, but if you are doing .NET 1.x development, unfortunately you will need VS 2003 still. Either side by side or install it in a virtual machine.
I guess you found your answer for the second question :)
Blogging at Incoherent Rambling