console-application

How to allow migration for a console application?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 15:32:33
When using asp.net core and ef core, I have no problem when invoking add-migration init . But when I apply the same approach on a console application below, I got an error saying: Unable to create an object of type 'StudentContext'. Add an implementation of 'IDesignTimeDbContextFactory' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time. What is the easiest way to fix this issue? The .net core console application project is as follows: appsettings.json { "ConnectionStrings": { "Storage": "Data Source=storage.db" } } EFCore

Running console applications on other monitor

断了今生、忘了曾经 提交于 2019-12-03 15:06:23
问题 I am using Visual Studio. I have a solution which contains 2 console application projects. When I pressed run they are appearing on the same screen with Visual Studio. But I need to see console outputs on the other screen which doesn't have Visual Studio. 回答1: Start the solution, click in the top left corner of the console window, Choose Properties , go to the Layout tab, un-check "Let System position window", push ok. Move the window to the other screen where you want it to start up. Close

How to run Console Application in Background (no UI)? [duplicate]

落花浮王杯 提交于 2019-12-03 14:59:12
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: .Net Console Application that Doesn’t Bring up a Console I have a console application written in VB.NET that will become a scheduled task on a web server. It will run every ten minutes. The problem is that every ten minutes it displays the empty black CMD window while processing, which can be distracting. How can I configure it to run in the background (with no CMD window displayed)? 回答1: Set on your Project in

What is the difference between public static void Main() and private static void Main() in a C# console application?

旧城冷巷雨未停 提交于 2019-12-03 14:19:55
问题 What is the difference between public static void Main() and private static void Main() in a C# console application? Specifically as it pertains to the Main() method (I understand the differences between public and private ). 回答1: To act as the start point in your application, the Main method is not required to be public . If you did decide to make it public , it would be possible for it to be called from other classes or assemblies. Typically you will not need to do this, so you can keep it

How to read values from config.json in Console Application

瘦欲@ 提交于 2019-12-03 13:59:46
I just installed ASP.NET 5 and created a Console Application in Visual Studio. I've added a file, config.json, to the root folder of the project. It looks like this: { "Data": { "TargetFolderLocations": { "TestFolder1": "Some path", "TestFolder2": "Another path" } } } My Program.cs looks like this public void Main(string[] args) { var configurationBuilder = new ConfigurationBuilder(Environment.CurrentDirectory) .AddJsonFile("config.json") .AddEnvironmentVariables(); Configuration = configurationBuilder.Build(); //Doesn't work...null all the time var test = Configuration.Get("Data

Multiple Consoles in a Single Console Application

前提是你 提交于 2019-12-03 13:03:04
I have created a C# Project which has multiple console applications in it. Now my question is: Is it possible to display multiple consoles when I run one application? if yes, how? Lets say, I have a Test Application, which is the main application. I have another two Console applications say, ABC and XYZ . Now, when i run the Test Application, the console of both applications ABC and XYZ should appear. I have written the following code: Console.WriteLine("\n\t Calling EXE..."); Process myProcess = new Process(); string Exepath = System.IO.Directory.GetCurrentDirectory() + "\\exe\\ABCApplication

Why does Console.Readline() have a limit on the length of text it allows? [duplicate]

被刻印的时光 ゝ 提交于 2019-12-03 11:46:14
This question already has answers here : Console.ReadLine() max length? (10 answers) Possible Duplicate: Console.Readline() max length? In my attempt to find a very simple text to speech application I decided it was faster to write my own . I noticed, however, that Console.Readline() is limited in the amount of text it allows per line to 254 characters; I can't find anything about this limit in the method documentation. Is this a limitation in the Windows stack, or a problem with my code? How can I overcome it? I could decide to read character by character with Console.Readkey() , but won't I

Publishing C# console application

谁说胖子不能爱 提交于 2019-12-03 11:12:29
I have developed a C# console application using VS2010. Now i would like to make it into a setup.exe. Is it possible to have this setup.exe as a standalone file to run my program? Meaning how can i achieve in obtaining setup.exe that when i click on that file it will run my console without even opening VS and without the need of my project folder on the workstation. I have tried numerous time doing myself but failed up till now. Some advice please. Thanks, 10e5x You can publish it. Go to your solution explorer. Right click on it. publish the application. After finishing the publishing wizard,

Making UI for console application [closed]

旧时模样 提交于 2019-12-03 11:10:00
How can I make an interface for console applications to make them look like edit.com under Microsoft's operating systems. Target languages are C, C++ and C#.NET. Have a look at curses : e.g.: http://sourceforge.net/projects/curses-sharp/ That would be based on a very simple framework which writes directly to the video to draw the underlying shadows, drop down menus, etc, not alone that, since 'Edit.com` would be written in assembler for speed in relation to drawing, this is quite ancient by today's standards, you can however take a look at PDCurses which will enable you to do this kind of

How to add a live (interactive) console window to Atom?

不问归期 提交于 2019-12-03 11:06:25
问题 Is it possible to add a live (interactive) console window to Atom? Note that this is similar to the article on adding a live console session to LightTable, except that it is for Atom. Essentially, I am interested in the integrated terminal emulation that Geany is capable of doing: Is there any way to do this in the Atom text editor from Github? 回答1: You might take a look at Atom Terminal Panel packages. 回答2: Yes it is possible. Don't know how they did, but there is a package "paltformio-ide".