473,582 Members | 3,083 Online
Bytes | Software Development & Data Engineering Community
+ 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.DataS et1.

I added: Imports MyProject.DataS et1
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.Data Set1' 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,Sy stem.Web.dll,Sy stem.Data.dll,S ystem.Drawing.d ll,System.XML.d ll 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 2841
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.DataS et1.

I added: Imports MyProject.DataS et1
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.Data Set1' 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,Sy stem.Web.dll,Sy stem.Data.dll,S ystem.Drawing.d ll,System.XML.d ll 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.M yNameSpace.MyCl ass.

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.P age

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()Priv ate Sub
InitializeCompo nent()
Me.SqlDataAdapt er1 = New System.Data.Sql Client.SqlDataA dapter
Me.SqlSelectCom mand1 = New System.Data.Sql Client.SqlComma nd
Me.SqlConnectio n1 = New System.Data.Sql Client.SqlConne ction
Me.DataSet11 = New MyProject.DataS et1
CType(Me.DataSe t11,
System.Componen tModel.ISupport Initialize).Beg inInit()
'
'SqlDataAdapter 1
'
Me.SqlDataAdapt er1.SelectComma nd = Me.SqlSelectCom mand1
'
'SqlSelectComma nd1
'
Me.SqlSelectCom mand1.CommandTe xt = "SELECT USER_NAME() AS UserName"
Me.SqlSelectCom mand1.Connectio n = Me.SqlConnectio n1
'
'SqlConnection1
'
Me.SqlConnectio n1.ConnectionSt ring = "deleted by poster - a valid
string existed"
'
'DataSet11
'
Me.DataSet11.Da taSetName = "DataSet1"
Me.DataSet11.Lo cale = New System.Globaliz ation.CultureIn fo("en-US")
CType(Me.DataSe t11,
System.Componen tModel.ISupport Initialize).End Init()

End Sub
Protected WithEvents SqlDataAdapter1 As
System.Data.Sql Client.SqlDataA dapter
Protected WithEvents SqlSelectComman d1 As System.Data.Sql Client.SqlComma nd
Protected WithEvents SqlConnection1 As System.Data.Sql Client.SqlConne ction
Protected WithEvents DataSet11 As MyProject.DataS et1

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

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

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) 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,Syste m.Data.dll,Syst em.Drawing.dll, System.Web.dll WebForm1.aspx.v b

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

Me.DataSet11 = New MyProject.DataS et1
~~~~~~~~~~~~~~~ ~~~
C:\Inetpub\wwwr oot\MyProject\W ebForm1.aspx.vb (38) : error BC30002: Type
'MyProje
ct.DataSet1' is not defined.

Protected WithEvents DataSet11 As MyProject.DataS et1
~~~~~~~~~~~~~~~ ~~~
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.M yNameSpace.MyCl ass.

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
3177
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 message: parsefcns.cc: In function `void get_token(std::ifstream*, char**)': parsefcns.cc:57: error: cannot convert `std::basic_string<char,...
4
11333
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 LNK2020: unresolved token (0A000007) memset LINK : error LNK2020: unresolved token (0A000008) free LINK : error LNK2020: unresolved token (0A00000A)...
1
1572
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 within my ASP.NET page, I am told that "Type 'Class1' is not defined", I cannot seem to find out how I can use this class, that exists within the same...
3
1457
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 needed to write a Jscript.Net class to encapsulate some Jscript.Net specific functionality, so I created a seperate folder, wrote the .js file and...
1
5374
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: Project: drawing_control, Configuration: Release Win32 ------ 1>Deleting intermediate and output files for project 'drawing_control', configuration...
3
2757
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 start thinking about ways to split this library up. In observing the .net framework, I've noticed that each major branch of the framework (eg....
0
1421
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 professional (and not VC# 2005 Express), I have installed all the listed prerequisites for compiling and running the project, but whenever I attempt to...
10
2700
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 in "error list" "REAL-TIME". At least, that was like that in VB.NET 2005 express. But in Visual C# .NET 2005 you won't be able to aware of coding...
1
4506
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 System.Drawing; namespace CSharpSchool { class HelloWinForm { static void Main () { Application.Run (new...
0
7886
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7809
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8312
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7920
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6569
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5685
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3809
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2312
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 we have to send another system
0
1147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.