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. Visual C# question

Visual C# question

Scheduled Pinned Locked Moved C#
questioncsharpc++javagame-dev
4 Posts 3 Posters 1 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.
  • D Offline
    D Offline
    dratti
    wrote on last edited by
    #1

    Using the standalone version of visual C# .NET: I'm writing a game. In my solution workspace I have 2 projects - the actual game and the map editor. I want the two to be able to share classes (as in code - not run time instances). That is if I write a class in the game project I want to be able to use it in the map editor. Im kind of new to C#, coming from java and c++. In java I would just jar the classes I wanted at compile time and put them in my classpath. How can I do this in visual C#? I think I need to make a .NET assembly, but Im really not sure how to do that. Thanks for any help Dave Ratti

    L I 2 Replies Last reply
    0
    • D dratti

      Using the standalone version of visual C# .NET: I'm writing a game. In my solution workspace I have 2 projects - the actual game and the map editor. I want the two to be able to share classes (as in code - not run time instances). That is if I write a class in the game project I want to be able to use it in the map editor. Im kind of new to C#, coming from java and c++. In java I would just jar the classes I wanted at compile time and put them in my classpath. How can I do this in visual C#? I think I need to make a .NET assembly, but Im really not sure how to do that. Thanks for any help Dave Ratti

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      dratti wrote: How can I do this in visual C#? I think I need to make a .NET assembly, but Im really not sure how to do that. AFAIK the standard version does not have that wizard, but just create a new windows form or console app, and remove the main method, and change the project property to compile to Class Library.

      leppie::AllocCPArticle(Generic DFA State Machine for .NET);

      D 1 Reply Last reply
      0
      • L leppie

        dratti wrote: How can I do this in visual C#? I think I need to make a .NET assembly, but Im really not sure how to do that. AFAIK the standard version does not have that wizard, but just create a new windows form or console app, and remove the main method, and change the project property to compile to Class Library.

        leppie::AllocCPArticle(Generic DFA State Machine for .NET);

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

        Thanks!

        1 Reply Last reply
        0
        • D dratti

          Using the standalone version of visual C# .NET: I'm writing a game. In my solution workspace I have 2 projects - the actual game and the map editor. I want the two to be able to share classes (as in code - not run time instances). That is if I write a class in the game project I want to be able to use it in the map editor. Im kind of new to C#, coming from java and c++. In java I would just jar the classes I wanted at compile time and put them in my classpath. How can I do this in visual C#? I think I need to make a .NET assembly, but Im really not sure how to do that. Thanks for any help Dave Ratti

          I Offline
          I Offline
          Iulian Serban
          wrote on last edited by
          #4

          You can make a dll library that holds the shared classes and you can access those classes from any project you want by including a reference to that dll project. To add such a project to your solution right click the solution in the Solution Explorer and select Add --> New Project and select Class Library and create a new project somewhere. Then to add references to that library and to make dependencies right click on the projects you want to set the dependency on and click dependencies. Then click the checkbox in front of the dll library and it automatically adds references to that poject and you can use those classes that you put in the dll library by just adding a: #using dllNamespace directive in the files you want to use it.

          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