473,473 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problems compiling with vbc.exe due to the project namespace

I have been developing web apps in Visual Studio 2003, but since the other
developers in my office don't use Visual Studio, I may have to stop too
unless there is an efficient way for them to compile the code outside of
Visual Studio if they need to adjust something I created.

I have been trying to use vbc.exe, but I'm having problems with references
to the DataSet I have created. Multiple pages reference my dataset -
"DataSet1", ... let's say such as:
Me.DataSet11 = New MyProject.DataSet1.

I added: Imports MyProject.DataSet1
to each page as necessary, but vbc.exe returns "Namespace or type 'DataSet1'
for the Imports 'MyProject' cannot be found. (If I try: Imports MyProject
instead, I get "Namespace or type 'MyProject' for the Imports 'MyProject'
cannot be found.)

Whether I add the Imports statements to the pages or not, I get a lot of
messages from vbc.exe like "Type 'MyProject.DataSet1' is not defined."

I thought it might have something to do with the references - /r in vbc.exe,
but of course I can't add MyProject.dll as a reference since it is what I'm
trying to build!

Right now, my vbc.exe command looks like:
vbc.exe /target:library /out:bin/MyProject.dll
/r:System.dll,System.Web.dll,System.Data.dll,System .Drawing.dll,System.XML.dll page1.aspx.vb page2.aspx.vb
(the /r section is actually much longer - I was getting other errors, but
added the .dll files as necessary to clear them up)

Thanks,
Scott Thompson

Sep 11 '06 #1
3 2813
sjt003 (nospam) wrote:
I have been developing web apps in Visual Studio 2003, but since the other
developers in my office don't use Visual Studio, I may have to stop too
unless there is an efficient way for them to compile the code outside of
Visual Studio if they need to adjust something I created.

I have been trying to use vbc.exe, but I'm having problems with references
to the DataSet I have created. Multiple pages reference my dataset -
"DataSet1", ... let's say such as:
Me.DataSet11 = New MyProject.DataSet1.

I added: Imports MyProject.DataSet1
to each page as necessary, but vbc.exe returns "Namespace or type 'DataSet1'
for the Imports 'MyProject' cannot be found. (If I try: Imports MyProject
instead, I get "Namespace or type 'MyProject' for the Imports 'MyProject'
cannot be found.)

Whether I add the Imports statements to the pages or not, I get a lot of
messages from vbc.exe like "Type 'MyProject.DataSet1' is not defined."

I thought it might have something to do with the references - /r in vbc.exe,
but of course I can't add MyProject.dll as a reference since it is what I'm
trying to build!

Right now, my vbc.exe command looks like:
vbc.exe /target:library /out:bin/MyProject.dll
/r:System.dll,System.Web.dll,System.Data.dll,System .Drawing.dll,System.XML.dll page1.aspx.vb page2.aspx.vb
(the /r section is actually much longer - I was getting other errors, but
added the .dll files as necessary to clear them up)
Inside VS, do you use the Namespace statement? Be aware that in
addition to the Namespace statement, the VB projects have a root
namespace that affects the names of all the namespaces you declare.
This can be found in the project properties.

Thus, if your root namespace for the project is something like:
Com.MyCompany

and in your code you use a Namespace statement:

Namespace MyNameSpace

Public Class MyClass
End Class

End Namespace

Then the fully qualified name for this class is:
Com.MyCompany.MyNameSpace.MyClass.

Perhaps this is what is causing your troubles? If not, can you show us
the code where the error is hitting?

Chris

Sep 11 '06 #2
Chris,

I'm not using the namespace statement. The name of the project namespace in
my example would by "MyProject".

OK, I just made a simple project for the sake of example. I named the
project "MyProject". When I look at the properties of the project, the root
namespace is named "MyProject".

There is one webform - Webform1.aspx. I added a DataAdapter to it and
generated a dataset named DataSet1 (DataSet1.xsd).

Here is the code (all system generated), the vbc.exe command is below too:
Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()Private Sub
InitializeComponent()
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.DataSet11 = New MyProject.DataSet1
CType(Me.DataSet11,
System.ComponentModel.ISupportInitialize).BeginIni t()
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT USER_NAME() AS UserName"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "deleted by poster - a valid
string existed"
'
'DataSet11
'
Me.DataSet11.DataSetName = "DataSet1"
Me.DataSet11.Locale = New System.Globalization.CultureInfo("en-US")
CType(Me.DataSet11,
System.ComponentModel.ISupportInitialize).EndInit( )

End Sub
Protected WithEvents SqlDataAdapter1 As
System.Data.SqlClient.SqlDataAdapter
Protected WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Protected WithEvents DataSet11 As MyProject.DataSet1

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

End Class

It compiles without a problem and loads the page in Visual Studio

I run the following vbc.exe command:
vbc.exe /target:library /out:bin/MyProject.dll /r:S
ystem.dll,System.Data.dll,System.Drawing.dll,Syste m.Web.dll WebForm1.aspx.vb

It returns the following error:
C:\Inetpub\wwwroot\MyProject\WebForm1.aspx.vb(11) : error BC30002: Type
'MyProje
ct.DataSet1' is not defined.

Me.DataSet11 = New MyProject.DataSet1
~~~~~~~~~~~~~~~~~~
C:\Inetpub\wwwroot\MyProject\WebForm1.aspx.vb(38) : error BC30002: Type
'MyProje
ct.DataSet1' is not defined.

Protected WithEvents DataSet11 As MyProject.DataSet1
~~~~~~~~~~~~~~~~~~
Thanks,
Scott
--
Scott Thompson
"Chris Dunaway" wrote:
>
Inside VS, do you use the Namespace statement? Be aware that in
addition to the Namespace statement, the VB projects have a root
namespace that affects the names of all the namespaces you declare.
This can be found in the project properties.

Thus, if your root namespace for the project is something like:
Com.MyCompany

and in your code you use a Namespace statement:

Namespace MyNameSpace

Public Class MyClass
End Class

End Namespace

Then the fully qualified name for this class is:
Com.MyCompany.MyNameSpace.MyClass.

Perhaps this is what is causing your troubles? If not, can you show us
the code where the error is hitting?

Chris

Sep 11 '06 #3
Anyone have any ideas? I'm stuck here...

Thanks,
--
Scott Thompson
Sep 14 '06 #4

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

Similar topics

11
by: Arturo DiDonna | last post by:
Hello everyone. I am trying to compile someone else code and I am stuck with compilation problems using the g++ 3.3 compiler. Basically, when compiling the following code, I get this error...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
1
by: Paul Darroch | last post by:
Hello I am trying to develop a class, which I will only use within my ASP.NET site. I therefore created a class and inserted a simple test method in it. However, when I try to use this class...
3
by: | last post by:
Hi all, I have a VB Project in VS2005 containing a few .vb files which have the appropriate classes:- Namespace - MyNameSpace Objects.vb - Objects Class Providers.vb - Providers Class I...
1
by: electrixnow | last post by:
Help!, I need to compile this code with static libs so it run on another XP machine that does'nt have MS Studio installed. When I compile now I get an ERROR: 1>------ Rebuild All started:...
3
by: Phaitour | last post by:
Hi there, I'm working on developing a large Class Library project that is slowly becoming a shared "framework" library amongst multiple applications. As this shared library grows, I need to...
0
by: Gary Stephenson | last post by:
Hi all, I am trying to work through the WPF example Sudoku app at http://msdn.microsoft.com/coding4fun/gaming/arcade/article.aspx?articleid=999502 Other than that I am using VS2005...
10
by: kimiraikkonen | last post by:
Visual C#.NET 2005 express has some issues, unlike VB.NET 2005 has none of them: The most annoying one is: For example if there's a coding error, it must be reported at the buttom of the screen...
1
by: BobLewiston | last post by:
I tried to compile a Windows Forms Application in Visual C# 2008 Express with this source code from the CSharpSchool tutorial at Programmer's Heaven:using System; using System.Windows.Forms; using...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.