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. C / C++ / MFC
  4. 'System': a namespace with this name does not exist

'System': a namespace with this name does not exist

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpdotnetc++asp-net
7 Posts 2 Posters 0 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 am NOT a C++ guy, so bear with me. I am working on a C#/WPF app that references two C++ projects. We just converted the solution from .Net Framework to .Net Core 6.0, and now the C++ projects won't compile while in the solution. If I open the C++ projects stand-alone, they compile file. Primarily I'm getting the compile time error

    'System': a namespace with this name does not exist

    I've been Googling and 99% of the answers [all say this](https://stackoverflow.com/questions/16732789/system-a-namespace-with-this-name-does-not-exist). I've tried the answers and still get the same errors. At this point I need help. I'm guessing it's some kind of configuration issue, but I really don't know. Thanks

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

    L 1 Reply Last reply
    0
    • K Kevin Marois

      I am NOT a C++ guy, so bear with me. I am working on a C#/WPF app that references two C++ projects. We just converted the solution from .Net Framework to .Net Core 6.0, and now the C++ projects won't compile while in the solution. If I open the C++ projects stand-alone, they compile file. Primarily I'm getting the compile time error

      'System': a namespace with this name does not exist

      I've been Googling and 99% of the answers [all say this](https://stackoverflow.com/questions/16732789/system-a-namespace-with-this-name-does-not-exist). I've tried the answers and still get the same errors. At this point I need help. I'm guessing it's some kind of configuration issue, but I really don't know. Thanks

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

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

      An error message by itself does not tell us much. What is the context, and are you sure this would not fit better in Managed C++/CLI Discussion Boards[^] ?

      K 1 Reply Last reply
      0
      • L Lost User

        An error message by itself does not tell us much. What is the context, and are you sure this would not fit better in Managed C++/CLI Discussion Boards[^] ?

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

        Richard MacCutchan wrote:

        What is the context

        Not sure what you mean by "what is the context". Like I said, the project is in a solution with a C#/WPF project and the C++ project now doesn't compile.

        Richard MacCutchan wrote:

        and are you sure this would not fit better in Managed C++/CLI Discussion Boards

        I have no clue. But I could move it there. Again, I have ZERO C++ experience, so I'm really in the dark with all this.

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

        L 1 Reply Last reply
        0
        • K Kevin Marois

          Richard MacCutchan wrote:

          What is the context

          Not sure what you mean by "what is the context". Like I said, the project is in a solution with a C#/WPF project and the C++ project now doesn't compile.

          Richard MacCutchan wrote:

          and are you sure this would not fit better in Managed C++/CLI Discussion Boards

          I have no clue. But I could move it there. Again, I have ZERO C++ experience, so I'm really in the dark with all this.

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

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

          Kevin Marois wrote:

          Not sure what you mean by "what is the context"

          All you have given us is an error message. We have no idea whether this is unmanaged or managed code, what the actual code that causes the error looks like &c.

          K 1 Reply Last reply
          0
          • L Lost User

            Kevin Marois wrote:

            Not sure what you mean by "what is the context"

            All you have given us is an error message. We have no idea whether this is unmanaged or managed code, what the actual code that causes the error looks like &c.

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

            OK, so here's the lines of code that are failing:

            using namespace System;
            using namespace System::Reflection;
            using namespace System::Runtime::CompilerServices;
            using namespace System::Runtime::InteropServices;
            using namespace System::Security::Permissions;

            This error occurs in the using statements in every C++ file in the project. It's a .Net 6 project, so I'm assuming it Managed code. I'm not trying to be difficult, but I just don't know what I'm looking at so it's hard for me to know what to post here.

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

            L 1 Reply Last reply
            0
            • K Kevin Marois

              OK, so here's the lines of code that are failing:

              using namespace System;
              using namespace System::Reflection;
              using namespace System::Runtime::CompilerServices;
              using namespace System::Runtime::InteropServices;
              using namespace System::Security::Permissions;

              This error occurs in the using statements in every C++ file in the project. It's a .Net 6 project, so I'm assuming it Managed code. I'm not trying to be difficult, but I just don't know what I'm looking at so it's hard for me to know what to post here.

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

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

              OK, what you have is managed C++, AKA C++/CLI, which uses .NET. Those using statements are correct and it should build. However since you are converting from the Net Framework you probably need to look at Migrating C++/CLI projects to .NET Core and .NET 5+ - .NET Core | Microsoft Learn[^].

              K 1 Reply Last reply
              0
              • L Lost User

                OK, what you have is managed C++, AKA C++/CLI, which uses .NET. Those using statements are correct and it should build. However since you are converting from the Net Framework you probably need to look at Migrating C++/CLI projects to .NET Core and .NET 5+ - .NET Core | Microsoft Learn[^].

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

                OK thanks. I'll take a look

                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
                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