Results 1 to 8 of 8

Thread: [RESOLVED] Creating Windows Applications in VB Net - Two

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2021
    Location
    Denmark
    Posts
    7

    Resolved [RESOLVED] Creating Windows Applications in VB Net - Two

    jmcilhinney responded to my first post on this topic. I would like to thank him/her for the contribution. I could not find a template for .NET Framework as he suggested, so I stuck with .NET, but made sure to be using Net 5.0 and avoid using MainForm as the name for my main form. I could display this form from this. So, I added some variables to the code, some objects onto the form (Labels, TextBoxes, PictureBox and a Menu) and allocated values to these variables from the textboxes in the _Load() Sub. No errors displayed. So, I tried to run it and got error BC30456, "Form1 is not a member of ManageKernels". Microsoft documentation said that I should add "<VBRuntime>default</VBRuntime" to my *.vbproj file, which I did. That resulted in me getting the errorBC2017, "could not find library Microsoft.VisualBasic.dll". I went into the Object Browser, found this dll file and clicked on the Add Reference button to add it to my project. The error remains. Nor can I see where this library has been added to my project. Some help would be greatly appreciated.

  2. #2
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,061

    Re: Creating Windows Applications in VB Net - Two

    Quote Originally Posted by KeithMcCloy View Post
    jmcilhinney responded to my first post on this topic. I would like to thank him/her for the contribution. I could not find a template for .NET Framework as he suggested
    Hi Keith,

    Maybe you said which version of VS you're using in your previous thread, I'm using: -
    Microsoft Visual Studio Community 2019 Version 16.8.4

    Opening VS and selecting 'Create a new project', I'm presented with a menu of templates. there is a scroll bar to the right to access the whole list, and an option below to 'Install more tools and features'. Assuming you have a relatively recent VS version it ought to be the same for you.

    It sounds as though the template that John suggested for you is the one called...
    'Windows Forms App (.NET Framework)'
    ...and is definitely in that menu.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    106,695

    Re: Creating Windows Applications in VB Net - Two

    I'm using VS2019 v16.9.4 and so should you be. If you're able to target .NET 5.0 then you must be using VS 2019 (I'm fairly certain that's true - I don't think VS 2017 supports .NET 5.0 and earlier versions definitely don't) so you should have installed the latest update. This is the template that you are using, or the equivalent for your version:

    Name:  WinForms App Project Template.jpg
Views: 61
Size:  22.3 KB

    Not too long ago, that template had a "(.NET)" suffix but they have removed that recently. This is the template you should be using:

    Name:  WinForms App Project (.NET Framework) Template.jpg
Views: 60
Size:  22.7 KB

    If you want to target .NET Framework then select a project template that targets .NET Framework.

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2021
    Location
    Denmark
    Posts
    7

    Re: Creating Windows Applications in VB Net - Two

    Attachment 181038
    Thank you both for your responses. I am using VS Ver 16.9.4, downloaded on about 15 April 2021. The attached picture shows that I created a new project using the three options to specify Visual Basic, Windows and Desktop to select the Windows Forms Apps option. There is no Windows Forms Apps (.Framework) option in the list. I then configured the project, checked that I am using .NET 5.0 (Current), for the form to display correctly. I ran this and the form displayed correctly. In the Properties window, I changed the name for Form1 to TopForm and changed the Text item as you can see in the attached picture. I tried to run this and got the BC30456 error. I noticed that in Solution Explorer, the Form1.vb and its subsets of VB Form1.Designer.vb and Form1.resx had not changed their names to reflect the new form name. In Solution explorer, I renamed the Form1.vb to TopForm.vb and the two sub-files automatically changed their names. I was not prompted to change all occurrences of Form 1 as I used to be. I ran this and again got the BC 30456 error. Advice on what I should be doing would be greatly appreciated.

  5. #5
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,061

    Re: Creating Windows Applications in VB Net - Two

    Quote Originally Posted by jmcilhinney View Post
    I'm using VS2019 v16.9.4 and so should you be.
    Ooops !
    Thanks John, I must've missed the pop-up notification, I'm now also using version 16.9.4. It's made no apparent difference to the templates however.

    Pop
    Along with the sunshine there has to be a little rain sometime.

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    106,695

    Re: Creating Windows Applications in VB Net - Two

    Quote Originally Posted by Poppa Mintin View Post
    It's made no apparent difference to the templates however.
    I'm sure that the .NET Core/5 project templates had a "(.NET)" suffix not long ago but I don't know when that was dropped. Unfortunately, most beginners have no idea there's even two options and, as you often have to scroll to see the .NET Framework option, there's an epidemic of people creating .NET Core/5 projects with no idea that there's any actual difference and getting caught out by subtle differences. Oh well, it keeps us off the streets I guess.

  7. #7
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,061

    Re: Creating Windows Applications in VB Net - Two

    Quote Originally Posted by jmcilhinney View Post
    Unfortunately, most beginners have no idea there's even two options and, as you often have to scroll to see the .NET Framework option.
    Yes, me included a few months ago.
    It's also a nuisance that one has to actually pass the cursor over the scroll bar to see it.


    Pop
    Along with the sunshine there has to be a little rain sometime.

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2021
    Location
    Denmark
    Posts
    7

    Re: Creating Windows Applications in VB Net - Two

    Thanks very much to John and Pops for your assistance. It has been greatly appreciated. I had originally downloaded from Visual Studio the Universal Windows Platform Development, and it does not include the Windows App (Framework) template. Once I also downloaded the .NET desktop development the Windows App (Framework) template appeared and so far it seems to work fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width