473,396 Members | 1,871 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,396 software developers and data experts.

Moving code to a vb.net class library

I'm moving some code from my asp.net application into a vb.net library so it
can be reused easily elsewhere. I have a vb class in my asp.net application
and I just took a copy of that file and made it a new class in a new VS.net
class library.

Now when I look at my new class in my new library, several of the imports
statements are being flagged by intellisense as invalid (that work fine in
the asp.net app). It looks to be any system.web namespace. The first being
system.web.HttpContext. Are these namespaces available in a Class Library?
Do I need to handle my imports differently? Not sure where to go from here
to make this code portable. Thanks!

Matt
Nov 18 '05 #1
3 1506
Imports are just shortcuts, so you type less. You are missing some assembly
references in your project - probably like System.Web, etc. ASP.NET apps
have templates that include some of these assemblies as references by
default, where as a library would not have them there by default.

"MattB" <so********@yahoo.com> wrote in message
news:2q************@uni-berlin.de...
I'm moving some code from my asp.net application into a vb.net library so it can be reused easily elsewhere. I have a vb class in my asp.net application and I just took a copy of that file and made it a new class in a new VS.net class library.

Now when I look at my new class in my new library, several of the imports
statements are being flagged by intellisense as invalid (that work fine in
the asp.net app). It looks to be any system.web namespace. The first being
system.web.HttpContext. Are these namespaces available in a Class Library?
Do I need to handle my imports differently? Not sure where to go from here
to make this code portable. Thanks!

Matt

Nov 18 '05 #2
Got it. Thanks!
I figured it was some kind of reference, but didn't know where to look to
add it.

Marina wrote:
Imports are just shortcuts, so you type less. You are missing some
assembly references in your project - probably like System.Web, etc.
ASP.NET apps have templates that include some of these assemblies as
references by default, where as a library would not have them there
by default.

"MattB" <so********@yahoo.com> wrote in message
news:2q************@uni-berlin.de...
I'm moving some code from my asp.net application into a vb.net
library so it can be reused easily elsewhere. I have a vb class in
my asp.net application and I just took a copy of that file and made
it a new class in a new VS.net class library.

Now when I look at my new class in my new library, several of the
imports statements are being flagged by intellisense as invalid
(that work fine in the asp.net app). It looks to be any system.web
namespace. The first being system.web.HttpContext. Are these
namespaces available in a Class Library? Do I need to handle my
imports differently? Not sure where to go from here to make this
code portable. Thanks!

Matt


Nov 18 '05 #3
Make sure the right References has choosen for the project.

chanmm

"MattB" <so********@yahoo.com> wrote in message
news:2q************@uni-berlin.de...
I'm moving some code from my asp.net application into a vb.net library so
it can be reused easily elsewhere. I have a vb class in my asp.net
application and I just took a copy of that file and made it a new class in
a new VS.net class library.

Now when I look at my new class in my new library, several of the imports
statements are being flagged by intellisense as invalid (that work fine in
the asp.net app). It looks to be any system.web namespace. The first being
system.web.HttpContext. Are these namespaces available in a Class Library?
Do I need to handle my imports differently? Not sure where to go from here
to make this code portable. Thanks!

Matt

Nov 18 '05 #4

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

Similar topics

2
by: jbmeeh | last post by:
I have an application in which I need to expose runtime moving and resizing of controls. Most of the functionality that I need is exposed by the CRectTracker class in the C++ library. Are there any...
1
by: Joshua Moore | last post by:
I'm sure this is an easy question/answer, but would greatly appreciate it :) I have a 20 mb project, and wanted to move several classes, especially forms, to a class library. I tried adding one...
5
by: Franck | last post by:
Hello, I've just moved to visual developper 2005 to do so, I also had to use the convert assistant. what it did; moving my file resx files that i had in a diresctory called resx to a new...
0
by: UJ | last post by:
I have a class that makes reference to a windows form. I am trying to make that class a class library and when I include the window file, it says that system.windows.form.form is not defined. ...
2
by: Adam Hartshorne | last post by:
I have just upgraded to Visual Studio 2005 and have loaded in a project i have been working on, and the code compiles ok but fails to link correctly, as shown below. Any suggestions about what is...
9
by: axs221 | last post by:
I am trying to move some of our large VBA Access front-end file into ActiveX DLL files. I created two DLL files so far, one was a module that contains code to integrate into the QuickBooks...
3
by: b747_440 | last post by:
Hello Newsgroup, I try to resize and move a picturebox. However, after each operation the picture box is being redrawn. This causes flickering. Is it possible to suppress the first redraw and draw...
2
by: Diogo Alves - Software Developer | last post by:
Greetings I would like to knowhow can I put a sliding panel... I've done this: if (panel1.Width < 300) { while (panel1.Width < 300) { panel1.Width = panel1.Width + 40;
4
by: =?Utf-8?B?R1Q=?= | last post by:
I have a Form which has a great number of events. I thought I would organize the project by moving some of the code into multiple '.cs' files (since the Form.cs was getting huge). When I move them,...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.