简体   繁体   English

Linux上的Visual Studio代码-当“ app.js不存在”时也不应该运行C#应用程序

[英]Visual Studio Code on Linux - How to run a C# application when “app.js does not exist”, nor should it

I am running VS Code on Ubuntu 14.04. 我在Ubuntu 14.04上运行VS Code。 I am trying to run a C# web application which my team can run just fine in Visual Studio on Windows. 我正在尝试运行一个C#Web应用程序,我的团队可以在Windows的Visual Studio中很好地运行它。 The problem is that Code gives me an error message, "/app.js does not exist". 问题是代码给我一条错误消息,“ / app.js不存在”。 No such file exists in our project, and I think I want to run it using "Startup.cs" instead, but despite trying to change the 'launch.json' file accordingly, another file that my team does not have, I still cannot get my project to run. 我们的项目中没有这样的文件,我想我想使用“ Startup.cs”运行它,但是尽管尝试相应地更改了“ launch.json”文件,但我的团队没有该文件,但我仍然无法让我的项目运行。 Has anyone experienced a similar problem? 有没有人遇到过类似的问题?

The .NET environment for Linux is currently in a pretty early state. Linux的.NET环境目前还处于早期状态。 Thus you can't do everything on Linux that you can enjoy on Windows. 因此,您无法在Windows上完成Windows所能享受的一切。 If you want to develop an ASP.NET application then you should read this guide on how to setup the environment to work with Visual Studio Code. 如果要开发ASP.NET应用程序,则应阅读本指南 ,了解如何设置环境以与Visual Studio Code一起使用。

If you have a C# application that can already be compiled and run on Linux then you can 如果您有一个已经可以在Linux上编译并运行的C#应用​​程序,则可以

Just for your interest: You can't currently debug C# projects in Visual Studio Code. 仅出于您的兴趣:您目前无法在Visual Studio Code中调试C#项目。

Perhaps you can try to open the project with Monodevelop? 也许您可以尝试使用Monodevelop打开项目? This is an open source IDE for C# that runs on linux. 这是在Linux上运行的C#的开源IDE。 It is compatible with VS projects. 它与VS项目兼容。 You will probably need to also install Mono (the open source .net runtime) to run Monodevelop. 您可能还需要安装Mono(开源.net运行时)来运行Monodevelop。

You may even be able to run your web app with the Mono runtime, although it has been always a bit behind the official Microsoft .net runtime (you may get 'class not found' exceptions if your code uses libraries that are not yet implemented in the Mono runtime). 您甚至可以使用Mono运行时来运行Web应用程序,尽管它始终落后于官方Microsoft .net运行时(如果代码使用的代码尚未在Java中实现,则可能会出现“找不到类”异常) Mono运行时)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM