Using namespace in C #

I am creating a game for a Windows phone in C # and I want to test some output and other data through the console. How to include classes (or namespace) from a phone application in a console project?

+4
source share
2 answers

At the top of the source code:

using YourNameSpace; 

Make sure your project has a code library, for example:

  • In Object Browser, find Links
  • Right-click Links and select Add Link ...
  • Locate the DLL that contains your namespace, either in the GAC or through the Overview tab
+4
source

using for example

 using MyGameStuff; 

or if you do not, in your code ...

 var sprite = new MyGameStuff.Sprite (); 

If you put your classes in another assembly (project), you need to add a link to your project / assembly.

If you do not have a project in your solution, you may also need to add the project to the solution and then reference the project from the main application.

+1
source

Source: https://habr.com/ru/post/1396335/


All Articles