Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Symptoms

You may receive the following error message during the compilation process when you recompile a VB.NET application to target the Microsoft .NET Framework 4.5.2:

'{Name}' is not a member of 'Windows'.


In this message, the "{Name}" placeholder is a child of the System.Windows namespace, such as "Forms" or "Markup."

For example,the error message may appear as follows:

'Forms' is not a member of 'Windows'.


Resolution

This issue involves conflicts of the .NET Framework 4.5.2 "Windows" namespace. It will occur in code that uses Windows.{Name} to refer to System.Windows.{Name}.

To resolve the issue, change the code to fully qualify the namespace, or import the full namespace and reference its types by their simple name.

For example, the following code will cause the error:

Module Module1

Sub Main()

Windows.Forms.MessageBox.Show("Example")

End Sub

End Module


However, the following code will compile successfully:

Imports System.Windows.Forms


Module Module1

Sub Main()

MessageBox.Show("Example")

End Sub

End Module


The following code will also compile successfully:

Module Module1

Sub Main()

System.Windows.Forms.MessageBox.Show("Example")

End Sub

End Module


Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×