advtree enumerates all nodes - vb.net

Using dotnetbar advTree and their support is already out of business
I need to enumerate through all nodes in AdvTree.
The problem is that I'm using vs.net 2010 pro and my project is .net fw 4.0 (full)
This is not supported in my version:
Private Shared Iterator Function
Anyone can advise how to make it work in vb.net 4.0? :)
https://www.devcomponents.com/kb2/?p=1357
Tried their sample and not supported :(

Related

Does VB.net support EnumerationOptions?

Microsoft documents EnumerationOptions at [https://learn.microsoft.com/en-us/dotnet/api/system.io.enumerationoptions?view=netcore-3.1]
and it seems to infer that the VB.Net code below would be acceptable
Dim ENumOptions = New System.IO.EnumerationOptions()
But it is not! Visual Studio reports "Type system.io.enumerationoptions is not defined"
What have I done wrong?
I'm guessing what's happening here is that you want to call Directory.GetFiles or the like and you want to do a recursive search without throwing an exception if you hit an inaccessible folder. If you're targeting the .NET Framework then too bad, because you can't. Go here and search for Directory.GetFiles filtered by .NET Framework 4.8 and .NET Core 3.1 and you'll see that the overload that uses EnumerationOptions is not available in the former.
If you are using below .Net 5 version,
Add reference to System.Management
Then Import.
Imports System.Management
From .Net 5 it is available in System.IO

"Could not resolve mscorlib ... .NETFramework,Version=v2.0" in VS2015 from VB6

My question is similar to others, but my particular nuance of this problem doesn't appear to have an answer I can find on here so far, so here goes. (edits in italics)
Our company has a deployed application written in VB6. Since VB6 development is no longer officially supported in Windows, our company made the decision to port our VB6 application to VB.NET.
(Prior to this edit, I had mentioned that the project was converted to VB.NET using VS 2015. This was incorrect, I discovered that my coworker had actually performed the conversion using VS 2008, and I was working on the 2008 project in 2015.)
So we are now working with the VB.NET conversion in VS2015. As many of us know, the VS 2008 converter does an incomplete job porting VB6 code to VB.NET code so there are many, many errors to sort through (as of this writing, all compile errors are fixed). In particular, though, I'm trying to open the various forms for the project in the Designer so I can see and work with them. The designer specifically is reporting the error:
Could not resolve mscorlib for target framework '.NETFramework,Version=v2.0'. This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.
I saw some mention of a 256 character limit on dependency paths. This dependency is met in my case. I have also confirmed that .NET Framework 2.0 is installed and active in my instance of Windows. I have seen the recommendation to upgrade the .NET Framework version as well, which was successful in itself but did not resolve this mscorlib issue.
Full call stack for this error follows:
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUniverse..ctor(IDesignTimeAssemblyLoader assemblyLoader, IVsDesignTimeAssemblyResolution projectAssemblyResolution, IVsSmartOpenScope dispenser)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUniverse.GetUniverse(IDesignTimeAssemblyLoader assemblyLoader, IVsDesignTimeAssemblyResolution projectAssemblyResolution, IVsSmartOpenScope dispenser)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkProvider..ctor(IVsDesignTimeAssemblyResolution assemblyResolution, IDesignTimeAssemblyLoader assemblyLoader, TypeDescriptionProvider parentProvider, IVsSmartOpenScope openScope)
at Microsoft.VisualStudio.Design.VsTargetFrameworkProviderService.get_TargetFrameworkProvider()
at Microsoft.VisualStudio.Design.VsTargetFrameworkProviderService.GetProvider(Type type)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
How can I gain the ability to view my project in the Designer?
As far as I know, opening VB6 files in VB.NET will not work. You will have to make modifications in Visual Studio 6.0 or re-write the application in VB.NET/C#.
Older versions of Visual Studio (until 2008) had some converters but they never really worked as expected.
You can take a look at Visual Basic Tools for Visual Studio, it "allows to work with classic VB workspaces and projects within Visual Studio.", this will allow you to modify the VB6 project in a newer version of Visual Studio but the code will remain VB6.
Regarding your exact issue, others have reported that the following worked for them:
Remove and add back project references that have warnings.
Rebuild the project
Remove and add back Microsoft.Office.Core
Good luck!
As someone who has converted a number of VB6 applications to VB.Net, I always advise a full rewrite. The languages are just too different. You waste far too much time trying to resolve issues of this type.
Better still, just leave the VB6 application running as is.
Microsoft's VB6 support statement

Does VB.Net 2003 support System.Collections.Generic?

I am planning to use a List in my application but when I was searching for System.Collections.Generic, it only has System.Collections. I tried to look it up in the "add reference" and its not there.
Could anybody tell me where I can add the reference for this.
Thanks for those who can help me
No. 2003 works with .net 1.1 and Generics were introduced in 2.0. You'll need Visual Studio 2005 or later.
Generics were introducted in .Net 2 . So if you work with .Net 2 or later it's supported

VB .NET vs. VB 2010

I just want to know if VB.NET and VB 2010 are the same.
I'm just wondering.
VB 2010 is the latest version of VB.Net. Microsoft dropped the ".Net" part of VB with the VB 2005 release.
Wikipedia has all you need to know about VB.net: Wikipedia Page
VB.NET is any version of Visal Basic since version 7, where the language moved to the .NET platform and became object oriented.
2010 isn't a version of the VB language, it's sometimes used to describe the version that comes with Visual Studio 2010, which is VB version 10.
As specified on the wiki page for VB.NET VB 2010, or VB 10.0 is a new version of the language commonly refered to as VB.NET.
as the time changed visual basic became more advanced. Before it used a p code compiler. but all the versions after vb 6.0 IDE it stopped using msvb60.dll and shifted to .NET framework which is now called VB.NET. But Microsoft removed the .NET after VB 2005 final release. Also it used a VBC.exe which is the new Visual Basic compiler. There was a lot of criticiscm after this because it was not compatible with Win 98 and previous versions.
Visual Basic .NET (VB.NET) implemented on the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language. Although ".NET" portion dropped in 2005,"Visual Basic .NET" to refer to all Visual Basic languages releases since 2002.
There is Visual Basic and Visual Basic .NET. Visual Basic .NET runs on the .NET framework and the former does not.
Basically yes, Vb 10 is just the newer version
Yes they are the same, but VB.Net runs with .NET framework.
Yes they are the same. Bassicaly VB 2010 is using .NET framework
Vb.net is the same as VB 2017. In your case it's 2010. Just more features
VB 2010 , because nobody is needed to know .net when they know vb
but in vb.net you also have to learn .net,
This version is also the latest
you can also have vb2010 express for free here
http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express
(OR)
get the paid version like pro edition here (trial only)
http://www.microsoft.com/en-us/download/details.aspx?id=2890
VB.NET is the language that you can use on the .NET framework. Before .NET framework evolved, Microsoft had a separate product called Visual Basic, and in 2002 when Microsoft came with .NET framework then they discontinued Visual Basic as independent product, and combined it in the .NET framework.
Basically .NET framework supports 50+ languages (Visual Basic is one of them, and C# is another commonly known language) which you can use to develop variety of applications. Over the years, Microsoft improved .NET framework, so thus the VB language to make it more smart.
The VB 2010 that you are asking is the Visual Basic language that came with the Visual Studio 2010.
VB 2010 is a part of the VB .NET family. VB.NET uses the .NET language runtime, while VB6 and previous VB does not. VB .NET is object-oriented, and the classic VB is event-driven.

How to: Programmatically detect if MSXML parser (version 3+) is installed or not

Can anyone help me out, how to detect if MSXML parser is installed on a machine or not. I looked for a registry entry,but unable to get one. I am writing a VB.NET application.
Thanks in advance :)
One way you can do it is to create an instance of one of the MSXML objects in your code. e.g. Dim t As Type
Dim o As Object
' If this code causes an exception the object doesn't exist
t = Type.GetTypeFromProgID("MSXML2.DOMDocument")
o = Activator.CreateInstance(t);
System.Runtime.InteropServices.Marshal.ReleaseComObject(o)
I apologize if my vb.net code is bad :)
I would check if these files exists and check the version.
Or I would use this
Or maybe there is a better way?
If possible, target MSXML 3.0. It's included in all Windows operating systems starting with Win2k SP4, so there's usually no need to check for it's presence.
Anyway, if you are using VB.NET, consider using the System.Xml namespace instead. It is part of the .net framework, which is needed by your VB.NET application anyway.
One thing to notice is that The use of MSXML is not supported in .NET applications since the GC inside MSXML is not compatible with .Net framework.