简体   繁体   English

如何在Visual Studio中创建一个真正空白的项目(2017)

[英]How to create a truly blank project in Visual Studio (2017)

It seems like there should be a way to do this, but I just can't seem to do it. 似乎应该有办法做到这一点,但我似乎无法做到这一点。 I love VS and I want to use it to develop web apps that are strictly HTML/Javascript based. 我喜欢VS,我想用它来开发严格基于HTML / Javascript的网络应用程序。 In other words, no C#, no VB, no resulting /bin folder, no web config, no nothing. 换句话说,没有C#,没有VB,没有结果/ bin文件夹,没有web配置,没有什么。 A blank project meaning "truly 100% blank" and not trying force me into some Microsoft technology or otherwise. 一个空白项目,意思是“真正100%空白”而不是试图强迫我使用某些Microsoft技术或其他方式。 I just want to use VS to write the code because it's still the best HTML/Javascript/Typescript/Everything-else-script editor out there. 我只想用VS编写代码,因为它仍然是最好的HTML / Javascript / Typescript / Everything-else-script编辑器。

Any thoughts on this? 有什么想法吗? Can it even be done? 甚至可以做到吗? Or is VS just too dependent on "Microsoft thinking" to allow this? 或者VS过于依赖“微软思考”来允许这个?

What you have described is indeed possible in Visual Studio 2017 Community. 您在Visual Studio 2017社区中确实可以实现所描述的内容。

在此输入图像描述

Step 1) Create a new Project via File / New / Project 步骤1)通过文件 / 新建 / 项目创建一个新项目

在此输入图像描述

Step 2) Select Other Project Types / Visual Studio Solutions / Blank Solution . 步骤2)选择其他项目类型 / Visual Studio解决方案 / 空白解决方案

在此输入图像描述

Step 3) Right-click the newly created solution and select Add / New Solution Folder . 步骤3)右键单击新创建的解决方案,然后选择添加 / 新建解决方案文件夹 This step may not seem important, but it seems that files cannot be added directly to a solution without first creating a "Solution Folder" . 此步骤似乎并不重要,但似乎无法在未先创建“解决方案文件夹”的情况下文件直接添加到解决方案中 This solution folder is virtual in that it does not correspond a physical folder location . 此解决方案文件夹是虚拟的,因为它与物理文件夹位置不对应

在此输入图像描述

Step 4) Now right-click the newly created Solution Folder and select Add / Existing Item . 步骤4)现在右键单击新创建的解决方案文件夹,然后选择添加 / 现有项目

在此输入图像描述

Step 5) Insert all the files you want to add. 步骤5)插入要添加的所有文件。 These may be added via the menu option in Step 4 or otherwise drag-and-dropped onto the solution folder ( not the solution itself!). 这些可以通过步骤4中的菜单选项添加,或以其他方式拖放到解决方案文件夹( 而不是解决方案本身!)。

在此输入图像描述

Notice that even after creating the new solution and adding files, the only things created by Visual Studio 2017 are the usual .vs internal folder and the solution file itself. 请注意,即使在创建新解决方案并添加文件之后,Visual Studio 2017创建的唯一内容就是通常的.vs内部文件夹和解决方案文件本身。

I haven't heard or found a template online that will do this. 我没有在网上听到或找到过这样做的模板。 I'm assuming you meant just HTML, JS/TypeScript, CSS/SASS etc. without .NET for "truly blank". 我假设你的意思只是HTML,JS / TypeScript,CSS / SASS等没有.NET的“真正空白”。 Me I just delete the files I don't use :) 我只是删除我不使用的文件:)

It seems that what you want is to start with an empty canvas like Blank Solution and then add your files in the solution. 看起来你想要的是从像Blank Solution这样的空白画布开始,然后在解决方案中添加你的文件。 You don't actually need to have library/console/web projects in a solution, you could just have html and js and whatever you use for web development. 您实际上不需要在解决方案中拥有库/控制台/ Web项目,您可以使用html和js以及用于Web开发的任何内容。 You can find the Blank Solution when you create a new project under the Other Project Types tab. 在“其他项目类型”选项卡下创建新项目时,可以找到“空白解决方案”。

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

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