none
'Forms' is not a member of 'Windows' on Net Framework 4.5.2 RRS feed

  • Question

  • I tried to change the Target Framework on my app recently from .NET Framework 4.5 to 4.5.2, but if I do I get the following error when trying to build: "'Forms' is not a member of 'Windows'" (that is, System.Windows.Forms). Changing to 4.5.1 works normally. I'm using Visual Studio 2013 Ultimate.
    Saturday, May 10, 2014 12:45 AM

Answers

  • I would suggest you create a new project targeted to 4.5. Build it. Save it. Then try changing that projects target framework to 4.5.2 and see if that works.

    If that works then I would recommend you provide the version of Visual Studio you are using and year. If it's Visual Studio Express then which version of Visual Studio Express (i.e. Desktop, Web, whatever).

    Then provide details on what your project that can not be upgraded to 4.5.2 does. And what .dlls it uses that are non standard such as Crystal Reports or anything that is non standard with regard to what Visual Studio provides directly.


    La vida loca

    Sunday, May 11, 2014 7:09 PM

All replies

  • it makes no sense to report thing like this user forum here. The community is based on user experience, however there is no experience with this. 

    Report this to Connect.

    http://connect.microsoft.com


    Success
    Cor

    Saturday, May 10, 2014 8:23 AM
  • I tried to change the Target Framework on my app recently from .NET Framework 4.5 to 4.5.2, but if I do I get the following error when trying to build: "'Forms' is not a member of 'Windows'" (that is, System.Windows.Forms). Changing to 4.5.1 works normally. I'm using Visual Studio 2013 Ultimate.

    What happens instead of changing the target framework for an app you already have if you start Visual Studio, create a New Project and when the New Project window opens, before you select a Project set the Framework to 4.5.2 and select a Windows Forms Application? Does the new project work or does it error out also?

    Known issues for the .NET Framework 4.5.2

    Application Compatibility in the .NET Framework


    La vida loca


    Saturday, May 10, 2014 9:12 AM
  • Well, this is strange. I created a new project with version 4.5.2 and  System.Windows.Forms works normally in this new project. What could it be?

    #EDIT:

    Oh I see now, the problem is that on .Net Framework 4.5.2 I have to write the full  System.Windows.Forms, cant just abbreviate it like  Windows.Forms. I don't know why though. Importing  System doesn't work.



    • Edited by andre_ss6 Saturday, May 10, 2014 5:32 PM
    • Proposed as answer by EricTViking Thursday, February 12, 2015 9:13 PM
    Saturday, May 10, 2014 5:20 PM
  • Well, this is strange. I created a new project with version 4.5.2 and System.Windows.Forms works normally in this new project. What could it be?

    I've no idea. But perhaps when you target 4.5.2 with an already created project maybe some of the default references for 4.5.2 framework are no longer checked in reference manager. So look at reference manager before you retarget the app to see what default references are checked and then after you retarget it, before you attempt to build it, see if the reference manager for Targeting: .NET Framework 4.5.2 has the same default references checked maybe.


    La vida loca


    Saturday, May 10, 2014 5:29 PM
  • This might be a bit of a stretch, but you are creating a Windows Forms application, right? If not, you would need to add a reference and import it. But in cases such as WPF, you may not be able to.

    “If you want something you've never had, you need to do something you've never done.”

    Don't forget to mark helpful posts and answers ! Answer an interesting question? Write a new article about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.

    Saturday, May 10, 2014 5:43 PM
    Moderator
  • They're all correctly referenced. And yes @Paul, I'm working with Windows Forms.
    Sunday, May 11, 2014 4:04 PM
  • I would suggest you create a new project targeted to 4.5. Build it. Save it. Then try changing that projects target framework to 4.5.2 and see if that works.

    If that works then I would recommend you provide the version of Visual Studio you are using and year. If it's Visual Studio Express then which version of Visual Studio Express (i.e. Desktop, Web, whatever).

    Then provide details on what your project that can not be upgraded to 4.5.2 does. And what .dlls it uses that are non standard such as Crystal Reports or anything that is non standard with regard to what Visual Studio provides directly.


    La vida loca

    Sunday, May 11, 2014 7:09 PM
  • I can confirm it is broken.  Create a new Windows Forms application, targeted at .NET 4.5 or .NET 4.5.1.  In the Form_Load(), do the following and intentionally not qualify it with System.

    So do this (if in VB.NET):

            If Windows.Forms.MessageBox.Show("Is .NET 4.5.2 broken?") = Windows.Forms.DialogResult.Yes Then
                Debug.Print("You are correct")
            End If


    It will compile fine.  Now, change the target framework to .NET 4.5.2.  It will fail with:

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

    If you instantiate something like a button without qualifying it with System, it works fine in .NET 4.5 and 4.5.1, but says the following in .NET 4.5.2:

    Type 'Windows.Forms.Button' is not defined.

    • Edited by osumatt_80 Monday, May 12, 2014 3:52 PM
    Monday, May 12, 2014 3:48 PM