1
votes

am programming a dedicated server inside unity3d and i will run it in -batchmode and -nographics. So if i made an Console.Print(); it's doesn't anything. I started to programming something permetting to write in the console and read lines form the console. When i got started i had a lot of problems. A lot of methods/ properties aren't not recognized from System.Console but not only from Console. I need some help with this. I have read somewhere than i must removing the core called dxncore50 in a project.json but i don't have any fille called like that. But i don't have any idea if it is true and how to do it.

Here's an example of code returning me the similar error with the title.

using System;
using UnityEngine;

namespace Windows
{
    public class ConsoleInput
    {
        public void Awake()
        {
            Console.CursorLeft = 0; //THE ERROR'S HERE
        }
    }
}
2
@mayo I tried before asking this question here, i had the same problems... same errors... than nowuser4646893
mm, what about this comment (almost the last comment on the site): "Anyone else trying to implement this in their unity project, you have to change the .net version of unity in the player settings in Unity 5 from .net 2.0 subset to .net 2.0 or it will give about 19 console errors. Once you do that you will be left with one error in ServerConsole.cs on line 38, you can either comment it out until you create your in game console and then send the string to that or you can directly send the string if you already have a console system. "mayo
@mayo Thank you very mutch for your help.user4646893
It works? Are you Ok if I make an answer of this question?mayo

2 Answers

1
votes

According almost the last comment on this link:

http://garry.tv/2014/04/23/unity-batchmode-console/

Anyone else trying to implement this in their unity project, you have to change the .net version of unity in the player settings in Unity 5 from .net 2.0 subset to .net 2.0 or it will give about 19 console errors. Once you do that you will be left with one error in ServerConsole.cs on line 38, you can either comment it out until you create your in game console and then send the string to that or you can directly send the string if you already have a console system.

0
votes

I believe this error is happening because you are working in the Windows namespace. Also you should check that you are referencing the mscorlib assembly. Finally, the asp.net tag is for websites. I do not think you are using that here.