Resolved My.Computer missing in Net5

aaaron

Well-known member
Joined
Jan 23, 2011
Messages
216
Programming Experience
10+
Looks like my Net5 app can not find My.Computer.

I searched the Internet thinking there must be much ado about a substitute. But no hits at all.

So I looked at a 4.8 solution using Visual Studio hoping to find the location but, it would not let me peek at the definition.

Namespace: Microsoft.VisualBasic.Devices

What is My.Computer? I take it it is not a simple dll someplace.

What can I do about Net5 not finding it.

It shows up often in the solution I'm converting.

Edit: I found Microsoft.VisualBasic.dll and Namespace: Microsoft.VisualBasic.Devices but that doesn't help me know what to do about it. Should I just forget it and find alternate ways to do the things it does for me now? Or is there a M5 equivalent?
 
Last edited:
Solution
My proxy classes is generated into the assembly when "Enable application framework" is turned on, which it is by default for the Windows Forms (.Net) project template. (project properties, Application page)

I see Microsoft.VisualBasic.Devices classes (that My proxy accesses) have moved from Microsoft.VisualBasic.dll to Microsoft.VisualBasic.Forms.dll in .Net 5.

Here's some talk about it with screenshots: Visual Basic WinForms Apps in .NET 5 and Visual Studio 16.8 | .NET Blog
My proxy classes is generated into the assembly when "Enable application framework" is turned on, which it is by default for the Windows Forms (.Net) project template. (project properties, Application page)

I see Microsoft.VisualBasic.Devices classes (that My proxy accesses) have moved from Microsoft.VisualBasic.dll to Microsoft.VisualBasic.Forms.dll in .Net 5.

Here's some talk about it with screenshots: Visual Basic WinForms Apps in .NET 5 and Visual Studio 16.8 | .NET Blog
 
Solution
My proxy classes is generated into the assembly when "Enable application framework" is turned on, which it is by default for the Windows Forms (.Net) project template. (project properties, Application page)

I see Microsoft.VisualBasic.Devices classes (that My proxy accesses) have moved from Microsoft.VisualBasic.dll to Microsoft.VisualBasic.Forms.dll in .Net 5.

Here's some talk about it with screenshots: Visual Basic WinForms Apps in .NET 5 and Visual Studio 16.8 | .NET Blog
That's easy foe you to say :)

I read the link twice and am now more confused than before I did that.

Is there one Application Framework, for Net5 or (as I believe now) there is one for VB and another for C#...

What's in it that's not in the compiler. Is Microsoft.VisualBasic.Forms.dl part of it?

Should I be getting Microsoft.VisualBasic.Forms.dll somehow. I don't find it in the COM references.

BTW: Why are the references labeled COM.

I don't know what your first line above should tell me. Is it saying My.Computer is available to me somehow?

Beside my interest in having insight enough to be able to comprehend everything discussed in the link you gave, I would also like to move along with my conversion to Net5. Bottom line is: what do I do about the code that uses My.Computer? Find another way? Or is there a Net5 equivalent to My.Computer.

In particular, in case I must find equivalent ways I'm now looking for a way to replace: My.Computer.Info.AvailablePhysicalMemory

For example, the ComputerInfo class is vb only. And part of vb application framework?

Thanks
 
Last edited:
Application framework is only for VB, everything in that article is about VB and application framework.

Create a new Winforms .Net project and try My.Computer there. It should work. Then you can check what is different with your other project.

The dll reference is part of the Microsoft.WindowsDesktop.App.WindowsForms framework dependency and is not added separately.
 
I did find

<MyType>WindowsForms</MyType>

This setting imports the My namespace members Visual Basic programmers are familiar with.
 
Back
Top