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. WPF
  4. Conversion to .Net Core Issues

Conversion to .Net Core Issues

Scheduled Pinned Locked Moved WPF
csharpdotnethelpasp-netwpf
5 Posts 2 Posters 16 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.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I converted a .Net Framework WPF app to .Net Core. I now have 1800+ compilation errors. :mad::mad: It seems like 99% of them are

    The name 'InitializeComponent' does not exist in the current context

    Since this is so widespread, I'm going to assume something in the conversion broke this. I've been Googling and trying different things but no help. I tried removing the obj & bin folders but that didn't solve anything. Anyone have any ideas on this?

    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

    Richard DeemingR 1 Reply Last reply
    0
    • K Kevin Marois

      I converted a .Net Framework WPF app to .Net Core. I now have 1800+ compilation errors. :mad::mad: It seems like 99% of them are

      The name 'InitializeComponent' does not exist in the current context

      Since this is so widespread, I'm going to assume something in the conversion broke this. I've been Googling and trying different things but no help. I tried removing the obj & bin folders but that didn't solve anything. Anyone have any ideas on this?

      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Double-check that your project has the correct SDK: Sdk="Microsoft.NET.Sdk.WindowsDesktop" Also double-check that in contains <UseWPF>true</UseWPF> within a <PropertyGroup> element.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      K 2 Replies Last reply
      0
      • Richard DeemingR Richard Deeming

        Double-check that your project has the correct SDK: Sdk="Microsoft.NET.Sdk.WindowsDesktop" Also double-check that in contains <UseWPF>true</UseWPF> within a <PropertyGroup> element.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        K Offline
        K Offline
        Kevin Marois
        wrote on last edited by
        #3

        I opened the project file in Notepad++. The first line of the csproj file is

        The second line exists in a PropertyGroup I tried replacing the SDK and recompiled. Same result. 1800+ errors Thanks

        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

        1 Reply Last reply
        0
        • Richard DeemingR Richard Deeming

          Double-check that your project has the correct SDK: Sdk="Microsoft.NET.Sdk.WindowsDesktop" Also double-check that in contains <UseWPF>true</UseWPF> within a <PropertyGroup> element.


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          K Offline
          K Offline
          Kevin Marois
          wrote on last edited by
          #4

          I've made a bit more progress on this. The app has multiple configurations. When the configuration is changed, a bar appears at the top that says

          Current solution contains incorrect configurations mappings. It may cause projects to not work correctly. Open the Configuration Manager to fix them

          None of the code wrapped in an #if / #endif sections are active, so this leads me to believe there's a config issue. Since the project file was converted from .Net Framework to .Net Core, I'm a bit unsure on what to look for. Any thoughts on this? Thanks!

          If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

          Richard DeemingR 1 Reply Last reply
          0
          • K Kevin Marois

            I've made a bit more progress on this. The app has multiple configurations. When the configuration is changed, a bar appears at the top that says

            Current solution contains incorrect configurations mappings. It may cause projects to not work correctly. Open the Configuration Manager to fix them

            None of the code wrapped in an #if / #endif sections are active, so this leads me to believe there's a config issue. Since the project file was converted from .Net Framework to .Net Core, I'm a bit unsure on what to look for. Any thoughts on this? Thanks!

            If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            It looks like that's related to "conditions" in the csproj referring to configuration profiles that don't exist in the solution. Look for things like:

            Debug

            and check that the configuration value matches an existing build configuration for your solution: Understand build configurations - Visual Studio (Windows) | Microsoft Learn[^]


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            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