VB - Root Namespace In The Domain Project Is Blank
Feb 10, 2010
I have an VS2008 solution with 2 projects, WebUI and Domain; WebUI references domain. The Root Namespace in the WebUI project is:MyCompany. MyProjectName.WebUI. The Root Namespace in the Domain project is blank. (Namespaces are manually declared for all classes). So everything has been working fine, until I tried to reference a class in Domain via a fully qualified path: [Code]
Does this make any sense? So, then I cleared my WebUI Root Namespace, and voila, the fully qualified declaration then does work. However, doing this then seemed to invalidate the registration of all my user controls on my pages. The only thing that seemed to solve this was in the codebehind of each user control, manually add a namespace of MyCompany.MyProjectName.WebUI. which might make sense as perhaps the namespaces of the pages somehow had still retained the root namespace value. But, if I was to create a brand new aspx page and drop a user control on (this is before manually adding the namespace), even that page couldn't properly register it. Yet, the user control properly rendered in design view. so the VS UI seemed to be able to properly resolve it, but the compiler seemingly can't.
So from what I can tell, I can at least get things to work by manually wrapping user controls in the proper namespace. Why this is necessary for aspx pages, that have no namespace specified, to see the user controls, seems to make no sense. Is there some fundamental principle I am misunderstanding??
View 2 Replies
ADVERTISEMENT
Feb 9, 2009
I VB 2005 you can set the root namespace name of a project under the project properties. Where can I set this using VB2008?
View 4 Replies
Jan 25, 2010
How does one gain programatic access to the information that is entered into the "My Project" properties Application section?I am able to pick up the assembly name from those properties, but I haven't been able to pick these up.Below is the line of code that makes me interested in picking this up programatically. I have found that if the name within the quotes for Sections (GenConfig) doesn't match exactly what is entered in those properties, I will get an application error during run time.How do I reference that property?Is there a better way to pick that value up?
Dim applicationSettingsSection As ClientSettingsSection = config.SectionGroups("applicationSettings").Sections("GenConfig.My.MySettings")
View 4 Replies
Mar 17, 2011
I need to read an xml document from a database record into an XDocument object in order for it to be deserialized. So that the deserialization will work, I need to apply a specific namespace to each of the level 1 elements. So XML looks a bit like this:
[Code]...
How do I prevent the blank/empty namespace being added to each child element of the element to which the required namespace has been applied?
View 1 Replies
Jan 6, 2010
I'm trying to set up a .NET 3.5 web service project in Visual Studio. My goal is to include a namespace in this web service that I can expose to web applications that references this web service.I have added the namespace "MyWebservices", but I am not able to find it after referencing the web service.[code]I have also attempted to modify the "Root Namespace" property of the web service project, but I can't get that to work for me either.
View 3 Replies
Feb 28, 2010
How to change root namespace of my program
View 6 Replies
Aug 21, 2009
[code]How do I do this in VB, while having a root namespace in the application, is this possible?
View 4 Replies
Sep 23, 2011
For those of you interestested in mathematics you can find a root of a number in two different ways. Lets say you want to find the 5th root of 27.
[Code]...
View 2 Replies
May 22, 2009
Connect to a WMI namespace across a domain with admin credentials?
View 8 Replies
Sep 27, 2010
I have a solution that contains many projects all using the same root namespace. No code files explicitly name a namespace. So lets say the root namespace is ExampleRootNamespace.Now a problem comes into play when I want to add an explicitly named namespace to one of the code files I am working on. I want to be able to isolate this code from the rest of the assembly to be able to run FxCop against it. So I add something like Namespace Interfaces.CSV to the code file.
This causes any code that references this assembly to need to say Imports ExampleRootNamespace.Interfaces.CSV. So far so good. I can even run FxCop against the assembly. The problem now is that in other assemblies I cannot say any longer things like:
Public class frmInputBoolean Inherits
ExampleRootNameSpace.frmFormTemplate
Visual Studio is now asking me to rename the namespace to:
Public class frmInputBoolean Inherits
Global.ExampleRootNameSpace.frmFormTemplate
There are hundreds of errors related to this. So my questions are:
1) Why would basically naming a namespace under the root for the first time cause issues with the program?
2) Are there any workarounds to this issue without renaming?
I also want to add that with regards to ExampleRootNamespace.Interfaces.CSV I am not referencing this anywhere in the codebase. I'm currently just referencing it from a unit test project. So I don't see why adding this namespace causes an issue.
View 2 Replies
Aug 28, 2011
I've been having fun with the xmldocument class recently but am struggling with namespaces. I've been trying (with some success) to merge parts of one XML file into another. The problem has been that one of them utilises a namespace on one of the interior nodes and therefore my xpath queries where failing when I tried to create a nodelist. This I fixed (after reading some great examples here) by adding a namespace manager and changing my query accordingly.
Everything looked fine initially and I appeared to end up with the desired effect, but the XML file that was created was failing in the target application. What I didn't realise at first (due to the length of the xml node values being wider than my screen!!) was that when I imported the nodes from one file to another, a blank names space was being added to the end of each node (xmlns="")
' load the xml template from the project resources
Dim fdf As New XmlDocument
fdf.LoadXml(My.Resources.fdf_template)
[Code]....
View 1 Replies
Apr 2, 2009
Attempting to pull WMI Win32 properties information from a server in a trusted domain using the delegate string listed at bottom and receive the error listed below. The account has fullpermisions on the target server's root and subs WMI namespace and wbemtest connects fine. And all servers are in 2003 Native AD forests and trusted for delgation?
Error:
Scriptname.vbs(20, 1) (null): A security package specific error occurred.
Connection Moniker:
Set objWMIService = GetObject("winmgmts:" _
[code]....
View 1 Replies
Apr 25, 2011
I have 2 projects, one built in VB.NET and another in C#.NET. I want to use certain functionality of VB.NET into C#.NET and hence I have added the dll file of VB.NET solution into C#.NET as a reference by browsing the dll from my system. Say dll name for VB.NET is myData.dll. In my C#.NET project I am trying to declare it as a namespace i.e. "using myData;" and its giving me an error of "Type or namespace name could not be found"
View 1 Replies
Jun 3, 2012
I decided to explore deeper into how blank forms and controls are created.I don't know where to start. I'm not expert by any means I believe I just now the basics.I tried and start new project but instead of windows form template I used Blank Project. Added a module and creating sub main.I created a new class and copied few lines from a previous project and it gave me several errors.Brushes, Color, Font, Graphics are not defined. I am not sure if it's correct but when I added System.Drawing Reference and System.Drawing Namespace the errors was removed.Moreover, 'My' is not declared.
I would like to know what basic references and namespaces I need to add.(Note: I tried to add all the referenced and namespaces found when I create a windows form project but the errors was not removed)Moreover, how to create my own form and controls.
View 9 Replies
Jul 4, 2010
What is required to use the "My. (anything)" namespace? i am starting a new project from a "Blank / Empty Project" add a new class
Shared sub main()
my. (anything)
end sub
now, logic says that im missing a reference or import, i have include all the references from a new forms project, so should not have any issues with this. but no.con someone enlighten me on the "My" namespace and what reference is required to use it.
View 5 Replies
Jun 29, 2011
I have a vb.net 3.5 class library project that needs to reference two assemblies that have the same namespace. We have two third party dll's in which one is version 5.1 and the other is version 6.1. They have the same dll filename and they utilize the same namespace and functions/class names. The project needs to use one or the other depending on a specific situation. I've investigated up on a c# process that uses the "extern alias" feature to pull in the different assemblies.
[URL]
What use is the Aliases property of assembly references in Visual Studio 8.It seems that this feature isn't fully available for vb.net. Things I've Tried I've renamed the 2nd dll and added both references to my project. At this point I get tons of: 'blah' is ambiguous in the namespace. So I need to alias the different versions. In vb.net you can do aliases on an imports statement like:
Imports version5 = Somedll.Something
The problem is I can't setup an assembly reference alias for the different versions of the dll. Apparently in vb.net you can't set these up in the reference properties window. So I tried setting them in in my project file like this:
<Reference Include="somedll.5.Navigation">
<HintPath>....UtilityThirdPartyDLLSsomedll.5.dll</HintPath>
<Aliases>SomeDLL5</Aliases>
[code]....
I would then expect this to work:
Imports version5 = SomeDLL5.Something
Imports version6 = SomeDLL6.Something
But the "SomeDLL5/6" doesn't show up in intellisense. So how can I reference both dll's in the same project?
View 3 Replies
May 14, 2009
I'm trying to make more use of namespaces and giving my project a more rigorous design, as it has been getting pretty messy.I was wondering,before I get started, is there a standard convention for the names and organization of namespaces?For instance,for a 3-tier program, should there always be a "UI", "Business",and "DataAccess" namespace (and is this what they're typically called)?Or should I just organize the project as I see fit?
View 2 Replies
Jan 3, 2010
I want to use project B property in project A. Hence, I added project B to my solution. How can i use the property of B? Can someone guide me? i'm new to vb.net..To my knowledge, we need to use namespace and create a new instance. Could someone guide me on how to use namespace for this purpose?
View 1 Replies
Jan 21, 2011
Regarding a console application and VB forum program - In searching XML parsing examples I find several using Console.Write and Console.Write - To show my inexperience I (out of habit going through a couple preliminary examples) I created a new VB project with a blank form - I then copied and pasted the XML example using the console commands Errors - I just found the "create console application"What is the difference between a console application and the project using a blank form? Can the console commands like Console.Write work with a VB form project?If so (#2)What is the advantage in creating a console application - why not just start with a blank form and go?
View 1 Replies
Sep 22, 2010
I have a function that works perfectly when I attempt to add a user from the same domain into a group of the same domain.
Function AddUserToGroup(ByVal strUserDN As String, ByVal strGroupDN As String, ByVal strGRPDC As String, ByVal strUserDC As String) As Boolean
Dim oUser As DirectoryEntry
[Code]....
The error is actually being thrown on the Invoke line, but as I said earlier, if the user is in the same domain, this works perfectly.
View 1 Replies
May 11, 2011
I'm developing an web application using VB.Net, and I would like to know, if is there any way to make a namespace to be viewed by all project without necessary Imports?
View 1 Replies
Jun 20, 2012
I am trying to create a custom LabelFor helper to apply by default instead of the standard LabelFor helper include in System.Web.Mvc.Html. I want my LabelFor to take model properties that are PascalCase and make a label that appears as multiple words. For example the property FirstName would appear as "First Name".
I found this post that shows how to make a custom LabelFor helper that allows the addition of html attributes. I recreated this helper in VB.Net and modified it to do what I want, but I am not able to get it to work.
[Code]...
The sample includes this Module in Namespace System.Web.Mvc.Html but when I add the namespace declaration to this module everything in the rest of the project goes haywire. For example, each of my models has a Primary Key property that is a Guid datatype and as soon as I add the namespace above to the module, I get several errors stating that System.Guid is not defined among other similar errors.
I've tried to import my project namespace into a view in order to use the custom helper, but then I get an error that says Overload resolution failed because no 'LabelFor' is most specific for these arguments.I am trying to avoid having to specify a DisplayName for every PascalCase property I have in many models.
View 1 Replies
Dec 5, 2009
Is that possible to create a class in vb.net that is not in the default namespace of the project?
for example, say you have a project call sample1, then automatially IDE will have everything default to the Sample1 as your namespace root rather than under global, which is find for most case.but I want to create some classes that is directly under global namespace
View 7 Replies
Sep 30, 2010
I've just picked up a project from someone who has recently left our company, and the project file for the project has somehow had XML documentation deactivated. Typing ''' no longer automatically creates XML documentation segments, and existing XML documentation within the code does not show up in Intellisense, and is also not correctly highlighted as XML documentation.
In addition, the Intellisense for the My. namespace contains only MySettings, Resources and Setting under the "All" tab. Everything else is missing. Attempting to manually write My. namespace code results in compile errors. These are not problems with the IDE; I can start a new project and both Intellisense and My. work fine in these new projects. I can only assume that this is something which has been set on the project itself.
View 3 Replies
Mar 4, 2009
how can I import the System.ServiceProcess namespace into a WPF project in VB.net (not C#)? The ServiceController object is not in the toolbox in VS2008 and can't see to figure it out. Any ideas? If that particular namespace cannot be imported into WPF projects, could somebody suggest another way of controlling windows services from a WPF application? I know this framework is focused more on multimedia apps, but would really like to switch over some of my tools to WPF.
View 2 Replies
Sep 27, 2010
I am working on a solution that does not name namespaces in code files. Instead it uses the root name space of the project (which is the same across all assemblies). Basically there is only one implicit namespace.
Well, I am trying to isolate some code so that I can run FxCop against it. I explicated named the code file with a namespace to do this. This works for FxCop, but it bricks the entire solution.Visual Studio is now asking me to prefix all uses of the implicit namespace with Global. So instead of:
[Code]...
View 1 Replies
Feb 2, 2009
I am noob to vb.net so be easy , i know in vb6 if you compile your project with p-code instead of native it can make a empty project 12kb, if i compile an blank project in .net it is 15kb with "Enable optimizations" enabled. is there anything else to make projects smaller?
View 3 Replies
Nov 17, 2009
When setting up the Ajax Control Toolkit's AutoComplete control, it creates an utoComplete.asmx and a AutoComplete.vb file. The AutoComplete.vb file automatically ends up in the App_Code folder. I was hoping to move all of these styled-classes into a separate namespace, but the compiler simply does not dig it. Is this possible, or must it be within the presentation layer to access the "Web" related namespaces?
View 1 Replies
Aug 11, 2011
I would use the System.Linq.Dynamic. I added the specified Dynamic.vb file, that starts like this:
[Code]...
to my (VB.NET)solution. Now Visual Studio does not recognize anymore in the project files the System.XXX references, proposing me to change them to Global.System.XXX
View 1 Replies
Jan 16, 2009
I've started to use a Vista machine for development. In case it is significant: I'm using MSBee so that I can code in the Visual Studio 2005 IDE while still building against the 1.1 framework.On the Vista machine, when I tried to build a particular vb project, I got this error:
error BC30464: Namespace or type'Compatibility' in the project-level Imports 'Microsoft.VisualBasic.Compatibility' cannot be found.
The same project built fine on my old XP machine. I checked in this folder on my Vista machine:
C:windowsmicrosoft.netFrameworkv1.1.4322
...and sure enough, "Microsoft.VisualBasic.Compatibility.dll" was missing. So was "Microsoft.VisualBasic.Compatibility.Data.dll". Copying them from my XP machine to my Vista machine allowed me to build the project successfully.I'm just a bit puzzled as to why this happened. Why was "Microsoft.VisualBasic.Compatibility.dll" missing? I'm also not very comfortable with my chosen solution - copying the DLL manually. It works, but surely there must be a better way.
As far as the configuration:
Vista:
.Net Framework 1.1
.Net Framework 1.1 SP1
.Net Framework 1.1 SDK
[code]....
View 1 Replies