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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Problem instantiating form classes created in other C# project

Problem instantiating form classes created in other C# project

Scheduled Pinned Locked Moved C#
helpcsharpvisual-studio
10 Posts 4 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.
  • J Offline
    J Offline
    Jacobus01
    wrote on last edited by
    #1

    Does anybody know why I can't instantiate a form in my program.cs class. I'm developing a solution with multiple projects. Some are win form applications, some are class libraries and some are web applications. In this case i'm working with a win forms application. I have created forms in another project and I wish to add them to a the new win form project. Intellisense is not picking up the class names. I've also made sure that the forms use the correct namespace but with no success. Help please!

    S D H 3 Replies Last reply
    0
    • J Jacobus01

      Does anybody know why I can't instantiate a form in my program.cs class. I'm developing a solution with multiple projects. Some are win form applications, some are class libraries and some are web applications. In this case i'm working with a win forms application. I have created forms in another project and I wish to add them to a the new win form project. Intellisense is not picking up the class names. I've also made sure that the forms use the correct namespace but with no success. Help please!

      S Offline
      S Offline
      sudman1
      wrote on last edited by
      #2

      Have you added the other project to the current project's references?

      J 1 Reply Last reply
      0
      • J Jacobus01

        Does anybody know why I can't instantiate a form in my program.cs class. I'm developing a solution with multiple projects. Some are win form applications, some are class libraries and some are web applications. In this case i'm working with a win forms application. I have created forms in another project and I wish to add them to a the new win form project. Intellisense is not picking up the class names. I've also made sure that the forms use the correct namespace but with no success. Help please!

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        Have you added the other project(s) to thi project's references? Have you added the correct using (s) at the top of the file (or used fully qualified names)?

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
        Why are you using VB6? Do you hate yourself? (Christian Graus)

        1 Reply Last reply
        0
        • S sudman1

          Have you added the other project to the current project's references?

          J Offline
          J Offline
          Jacobus01
          wrote on last edited by
          #4

          No. I'm trying to merge the two projects into one project. There is an existing project and I'm just adding the form classes. Not the project itself. By just adding the new project and setting the references I'm able to access those forms that i need. Unfortunately my bosses don't want the solution working in that way. thus I'm forced to merge the two. I'm adding the forms classes under a folder and not in the root of the project. I can even view them in the designer. I've never encountered this problem before.

          1 Reply Last reply
          0
          • J Jacobus01

            Does anybody know why I can't instantiate a form in my program.cs class. I'm developing a solution with multiple projects. Some are win form applications, some are class libraries and some are web applications. In this case i'm working with a win forms application. I have created forms in another project and I wish to add them to a the new win form project. Intellisense is not picking up the class names. I've also made sure that the forms use the correct namespace but with no success. Help please!

            H Offline
            H Offline
            Henry Minute
            wrote on last edited by
            #5

            How about the .designer.cs file? Does that have the correct namespace? If none of that works, temporarily comment out any references to the merged forms, clean the solution and do a rebuild. If none of that works, I give up, although obviously you can't.

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            J 1 Reply Last reply
            0
            • H Henry Minute

              How about the .designer.cs file? Does that have the correct namespace? If none of that works, temporarily comment out any references to the merged forms, clean the solution and do a rebuild. If none of that works, I give up, although obviously you can't.

              Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

              J Offline
              J Offline
              Jacobus01
              wrote on last edited by
              #6

              The .designer.cs files all contain the correct namespace. I've tried rebuilding - no success. Cleaned the solution as well. Strange thing is that I can't access the folder in my using directives.

              H 1 Reply Last reply
              0
              • J Jacobus01

                The .designer.cs files all contain the correct namespace. I've tried rebuilding - no success. Cleaned the solution as well. Strange thing is that I can't access the folder in my using directives.

                H Offline
                H Offline
                Henry Minute
                wrote on last edited by
                #7

                Is it a permissions/trust thing? If one machine is Vista and the other XP, this can cause problems.

                Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                J 1 Reply Last reply
                0
                • H Henry Minute

                  Is it a permissions/trust thing? If one machine is Vista and the other XP, this can cause problems.

                  Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                  J Offline
                  J Offline
                  Jacobus01
                  wrote on last edited by
                  #8

                  No, both projects reside om one machine running xp. I'm going to create new forms in the current project and rename them exactly the same as the forms in the other project and then attempt to replace them. Hopefully this'll work.

                  H 1 Reply Last reply
                  0
                  • J Jacobus01

                    No, both projects reside om one machine running xp. I'm going to create new forms in the current project and rename them exactly the same as the forms in the other project and then attempt to replace them. Hopefully this'll work.

                    H Offline
                    H Offline
                    Henry Minute
                    wrote on last edited by
                    #9

                    Good old brute-force! :-D

                    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                    J 1 Reply Last reply
                    0
                    • H Henry Minute

                      Good old brute-force! :-D

                      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                      J Offline
                      J Offline
                      Jacobus01
                      wrote on last edited by
                      #10

                      Didn't work. :( Now I have to copy-paste all the code :wtf:

                      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