如何在Web应用程序ASP.net MVC中嵌入C#.net控制台应用程序[重复]

时间:2023-01-20 18:46:25

This question already has an answer here:

这个问题在这里已有答案:

I know that my question is wide and I am seeking for hints and keywords that would push my research forward. I have checked the following links Embedding a DOS console in a windows form and How to embed a Console application inside a Winforms application, but all I can find is embedding console to Winform.

我知道我的问题很广泛,我正在寻找可以推动我的研究的提示和关键词。我检查了以下链接在Windows窗体中嵌入DOS控制台以及如何在Winforms应用程序中嵌入控制台应用程序,但我能找到的只是将控制台嵌入到Winform中。

My objective is to first run the console which imitates the insert sql functionality. Then or synchronously, the Web Application should also start. So I have two applications in the same solution a C#.net Console App and a Web App.

我的目标是首先运行模仿insert sql功能的控制台。然后或同步,Web应用程序也应该启动。所以我在同一个解决方案中有两个应用程序,一个C#.net控制台应用程序和一个Web应用程序。

Is this possible? Help please.

这可能吗?请帮忙。

1 个解决方案

#1


You can add a Console application in the same solution as your ASP.NET Web Application project, and these two can use the same class libraries. For local testing through Visual Studio you can then add both these as Startup projects.

您可以在与ASP.NET Web应用程序项目相同的解决方案中添加控制台应用程序,这两个可以使用相同的类库。对于通过Visual Studio进行本地测试,您可以将它们作为启动项目添加。

#1


You can add a Console application in the same solution as your ASP.NET Web Application project, and these two can use the same class libraries. For local testing through Visual Studio you can then add both these as Startup projects.

您可以在与ASP.NET Web应用程序项目相同的解决方案中添加控制台应用程序,这两个可以使用相同的类库。对于通过Visual Studio进行本地测试,您可以将它们作为启动项目添加。