Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Not All On

Not All On

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpquestion
7 Posts 3 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michaelbarb
    wrote on last edited by
    #1

    I have figured out that when you base a program on Core3.1 or .Net5 you do not have all of it available to you. There are at least 2 switches you have to set to true in the csproj file: UseWPF and UseWindowsForms. Are there others? Most important, how do you know which features are turned on and which are turned off?

    So many years of programming I have forgotten more languages than I know.

    L M 2 Replies Last reply
    0
    • M michaelbarb

      I have figured out that when you base a program on Core3.1 or .Net5 you do not have all of it available to you. There are at least 2 switches you have to set to true in the csproj file: UseWPF and UseWindowsForms. Are there others? Most important, how do you know which features are turned on and which are turned off?

      So many years of programming I have forgotten more languages than I know.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Sounds like an alternative to the "project type". I expect (guess) you might be able to accomplish the same thing based on the references you add ... which requires knowing what dll(s) a given feature uses. Previously, there was no explicit WPF window "class" library (project), but you could build one with the appropriate references included. I have used Windows Forms chart controls in a WPF app; that would imply setting both switches (if they're not mutually exclusive).

      It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

      M 1 Reply Last reply
      0
      • L Lost User

        Sounds like an alternative to the "project type". I expect (guess) you might be able to accomplish the same thing based on the references you add ... which requires knowing what dll(s) a given feature uses. Previously, there was no explicit WPF window "class" library (project), but you could build one with the appropriate references included. I have used Windows Forms chart controls in a WPF app; that would imply setting both switches (if they're not mutually exclusive).

        It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

        M Offline
        M Offline
        michaelbarb
        wrote on last edited by
        #3

        I have discovered on other .Net calls you need both switches. Still, I think there is a lot of overlap put do not know for sure. When you look at dependencies in Project Explorer, both switches show up as the same thing.

        So many years of programming I have forgotten more languages than I know.

        1 Reply Last reply
        0
        • M michaelbarb

          I have figured out that when you base a program on Core3.1 or .Net5 you do not have all of it available to you. There are at least 2 switches you have to set to true in the csproj file: UseWPF and UseWindowsForms. Are there others? Most important, how do you know which features are turned on and which are turned off?

          So many years of programming I have forgotten more languages than I know.

          M Offline
          M Offline
          michaelbarb
          wrote on last edited by
          #4

          This is an update of the question: I have figured out that when you base a new project on Core3.1 or .Net5 you may not have all of objects available to you. There are at least 2 switches you have to set to true in the csproj file: UseWPF and UseWindowsForms. Are there others? Most important, how do you know which objects are turned on and which are turned off? Go to Object browser. This is a massive list of objects. It does show what rev of framework or core most objects are in. It does not show what switch it is under. Look up a class in Microsoft docs. Again you can get an idea of the version but no mention of the switches in csproj. These switches are in MSBuild. The only thing I can find on them are at:MSBuild properties for Microsoft.NET.Sdk.Desktop - .NET | Microsoft Docs[^] I know it may be a difficult question. I tried posting it on StackOverflow. I never get an answer and someone keeps marking it down. There is no comment as to why. Eventually it gets closed and hidden. I have heard that StackOverflow can be arrogant. I never understood why until now.

          So many years of programming I have forgotten more languages than I know.

          D 1 Reply Last reply
          0
          • M michaelbarb

            This is an update of the question: I have figured out that when you base a new project on Core3.1 or .Net5 you may not have all of objects available to you. There are at least 2 switches you have to set to true in the csproj file: UseWPF and UseWindowsForms. Are there others? Most important, how do you know which objects are turned on and which are turned off? Go to Object browser. This is a massive list of objects. It does show what rev of framework or core most objects are in. It does not show what switch it is under. Look up a class in Microsoft docs. Again you can get an idea of the version but no mention of the switches in csproj. These switches are in MSBuild. The only thing I can find on them are at:MSBuild properties for Microsoft.NET.Sdk.Desktop - .NET | Microsoft Docs[^] I know it may be a difficult question. I tried posting it on StackOverflow. I never get an answer and someone keeps marking it down. There is no comment as to why. Eventually it gets closed and hidden. I have heard that StackOverflow can be arrogant. I never understood why until now.

            So many years of programming I have forgotten more languages than I know.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            It depends on what you type on the "dotnet new" command line. If you do "dotnet new wpf", the WPF option in the csproj file is already turned on for you. The same goes for "dotnet new winforms". It sounds like you're doing something different on the "dotnet new" command line and having to make changes to the csproj manually to convert it to a different project type. If you want to see the list of project templates, just type "dotnet new -l".

            Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
            Dave Kreskowiak

            M 1 Reply Last reply
            0
            • D Dave Kreskowiak

              It depends on what you type on the "dotnet new" command line. If you do "dotnet new wpf", the WPF option in the csproj file is already turned on for you. The same goes for "dotnet new winforms". It sounds like you're doing something different on the "dotnet new" command line and having to make changes to the csproj manually to convert it to a different project type. If you want to see the list of project templates, just type "dotnet new -l".

              Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
              Dave Kreskowiak

              M Offline
              M Offline
              michaelbarb
              wrote on last edited by
              #6

              As part of a solution we have a project that started from the Class Library template. It does not have any screens but does have some custom controls and other things that required the UseWPF and UseWindowsForms switches be turned on. There is really no template set up for this.

              So many years of programming I have forgotten more languages than I know.

              D 1 Reply Last reply
              0
              • M michaelbarb

                As part of a solution we have a project that started from the Class Library template. It does not have any screens but does have some custom controls and other things that required the UseWPF and UseWindowsForms switches be turned on. There is really no template set up for this.

                So many years of programming I have forgotten more languages than I know.

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Weird, but OK. I know I know nothing of your project, but I probably would have split that up into two separate libraries, one for each type of project, but I understand there are reasons I don't know about. There is no list of configuration "switches" (UseWPF or UseWinForms) used in csproj files that I can find anywhere. The last-ditch effort to find those would probably be to create a new project of each template type and go look in their csproj files for what's being used.

                Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
                Dave Kreskowiak

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups