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#
  4. Shortcut classes in another project

Shortcut classes in another project

Scheduled Pinned Locked Moved C#
phpcomquestion
9 Posts 5 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.
  • M Offline
    M Offline
    mehrdadc48
    wrote on last edited by
    #1

    Hi, i've downloaded a sample application from here it has two projects; First a class library project with some classes and interfaces and another a silverlight application that has shortcuts to classes and interfaces of first one. How can a project has shortcuts to classes of another project? And what does it mean? It's in that project not this! I'm confused...

    Best wishes

    W L 2 Replies Last reply
    0
    • M mehrdadc48

      Hi, i've downloaded a sample application from here it has two projects; First a class library project with some classes and interfaces and another a silverlight application that has shortcuts to classes and interfaces of first one. How can a project has shortcuts to classes of another project? And what does it mean? It's in that project not this! I'm confused...

      Best wishes

      W Offline
      W Offline
      Wayne Gaylard
      wrote on last edited by
      #2

      The class library is compiled into a dynamic link library (dll), which is then referenced by the silverlight application. This gives the silverlight app the ability to use classes and interfaces defined in the class library project. So to use the both, you need to first compile the library project, and then add a reference to the library project in the silverlight project, using the 'add reference' link in project explorer of Visual Studio. Hope this helps

      When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

      1 Reply Last reply
      0
      • M mehrdadc48

        Hi, i've downloaded a sample application from here it has two projects; First a class library project with some classes and interfaces and another a silverlight application that has shortcuts to classes and interfaces of first one. How can a project has shortcuts to classes of another project? And what does it mean? It's in that project not this! I'm confused...

        Best wishes

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

        In Visual Studio's 'Add Existing Item' dialog box, the 'Add' button has a drop down option called 'Add As Link' that does the job. It does not copy the file to the project folder, it just creates a shortcut to the actual file. So, the file can be shared with multiple project. This is a very dirty thing to do. Ideally, you should abstract common code into a separate class library.

        M P 2 Replies Last reply
        0
        • L Lost User

          In Visual Studio's 'Add Existing Item' dialog box, the 'Add' button has a drop down option called 'Add As Link' that does the job. It does not copy the file to the project folder, it just creates a shortcut to the actual file. So, the file can be shared with multiple project. This is a very dirty thing to do. Ideally, you should abstract common code into a separate class library.

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

          thank you Shameel

          Best wishes

          1 Reply Last reply
          0
          • L Lost User

            In Visual Studio's 'Add Existing Item' dialog box, the 'Add' button has a drop down option called 'Add As Link' that does the job. It does not copy the file to the project folder, it just creates a shortcut to the actual file. So, the file can be shared with multiple project. This is a very dirty thing to do. Ideally, you should abstract common code into a separate class library.

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Ideally is the word, except if you want to share code between two different versions of the CLR. This is the method that you are pretty much forced to do if you want the same code to work between WP7, Silverlight and WPF.

            Forgive your enemies - it messes with their heads

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            L S 2 Replies Last reply
            0
            • P Pete OHanlon

              Ideally is the word, except if you want to share code between two different versions of the CLR. This is the method that you are pretty much forced to do if you want the same code to work between WP7, Silverlight and WPF.

              Forgive your enemies - it messes with their heads

              "Mind bleach! Send me mind bleach!" - Nagy Vilmos

              My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

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

              As long as you share files across same kind of projects that are targeted for different platforms, you are fine. But if you share file with projects of different nature, changing the file in one project may render the other project not compile at all (and trying to fix it may make the other project not compile). And that is something really dirty.

              P 1 Reply Last reply
              0
              • L Lost User

                As long as you share files across same kind of projects that are targeted for different platforms, you are fine. But if you share file with projects of different nature, changing the file in one project may render the other project not compile at all (and trying to fix it may make the other project not compile). And that is something really dirty.

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                Indeed, but as I say, sometimes it's necessary. Welcome to the world of the professional WPF/Silverlight developer.

                Forgive your enemies - it messes with their heads

                "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                1 Reply Last reply
                0
                • P Pete OHanlon

                  Ideally is the word, except if you want to share code between two different versions of the CLR. This is the method that you are pretty much forced to do if you want the same code to work between WP7, Silverlight and WPF.

                  Forgive your enemies - it messes with their heads

                  "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                  My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                  S Offline
                  S Offline
                  Super Lloyd
                  wrote on last edited by
                  #8

                  BTW, there is a new way! :) http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981[^] Although.. more convenient but more restrictive....

                  A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

                  P 1 Reply Last reply
                  0
                  • S Super Lloyd

                    BTW, there is a new way! :) http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981[^] Although.. more convenient but more restrictive....

                    A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

                    P Offline
                    P Offline
                    Pete OHanlon
                    wrote on last edited by
                    #9

                    Looks good. Nice find.:thumbsup:

                    Forgive your enemies - it messes with their heads

                    "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                    My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                    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