使用grunt和bower与WebSite项目进行HTML5开发,还是在Visual Studio 2015中创建HTML5 Web应用程序?

问题描述:

我想构建一个自定义的PURE HTML5 Web模板,用于HTML5 / CSS3 / JavaScript单页面应用程序开发,然后将其用作SPA HTML5 Web开发的起始位置。

I want to build a custom PURE HTML5 Web Template, for HTML5/CSS3/JavaScript single page application development, and then use that as a starting place for SPA HTML5 web development.

Microsoft明确建议使用Web应用程序,但不提供纯HTML5 Web应用程序模板,因此此任务留给最终用户。

Microsoft clearly recommends using Web Applications, but provides NO pure HTML5 web application template, thus this task is left to end users.

我不是在问我是否应该使用 ASP.NET网站或ASP.NET Web应用程序而不是我问,我可以安排哪些模板配置,让我使用最现代的HTML5工具和工作流程,以及它是Web应用程序(带有.csproj或.xproj项目文件)还是Web站点项目(基于文件夹的项目)?

I am not asking if I should use an ASP.NET Web Site or ASP.NET Web Application instead I am asking, what template configuration can I arrange that will let me use the most modern HTML5 tools and workflows, and is it the Web Application (with .csproj or .xproj project file) or Web Site project (a folder based project)?

对于开发人员需要构建项目的项目纯HTML5 SPA,可能与ExtJS或可能与Angular或类似的东西,首选是在文件 - >新网站和文件 - >新的Web应用程序之间。

For projects where a developer needs to build a pure HTML5 SPA, maybe with ExtJS or maybe with Angular, or something equivalent, the first choice made is between File-> New Web Site and File -> New Web Application.

如果以后我的HTML5项目可能会稍后添加一些ASP.NET,很明显我应该选择文件 - >新建Web应用程序,但是没有提供HTML5模板,所以我希望构建自己的模板和用那个。但它应该基于什么?

If it may be that later my HTML5 project may get some ASP.NET added later, it is clear I should choose File -> New Web application, but there is NO HTML5 template provided, so I am looking to build my own Template and use that. But what should it be based on?

对于WebSite选项,单击文件新建网站,然后获得基于文件夹的项目,但没有新的grunt / bower支持。

For the WebSite option, you click file New Web Site, and you get a folder-based project, but none of the new grunt/bower support.

我正在寻找一种方法来充分利用这两种选择。如果单击File New WebSite,我可以获得咕噜/凉亭支持吗?或者,如果我单击File New Project,我可以以某种方式进行纯HTML5工作吗?

I am looking for a way to get the best of both choices. Can I get grunt/bower support if I click File New WebSite? Or can I do pure HTML5 work somehow if I click File New Project?

有可能将纯HTML5 Web开发.csproj + .sln项目自己整合在一起,开始与一些示例曾经在codeplex上,现在在 GitHub
在我看来,基于.csproj或.xproj的root用于纯HTML5开发的好处是:

It is possible to crib a pure HTML5 Web Development .csproj + .sln project together myself, starting with some examples that used to be on codeplex and are now on GitHub It seems to me that the benefits of a .csproj or .xproj based root for pure HTML5 development are:


  • 我只能指定我想在项目浏览器中看到的文件。

  • I can specify only the files I want to see in my project explorer.

我可以轻松地将ASP.NET webapi控制器添加到我的纯项目而无需重建项目。

I can easily add ASP.NET webapi controllers to my "pure" project without rebuilding the project.

我可以使用ASP.NET 5(DNX)Web应用程序模板(.xproj)之一吗? d只需删除所有C#的东西,获得一个有效的纯HTML5开发模板,并保留所有新的javascript grunt / bower工具?或者我是否必须坚持使用Web站点(文件夹级别)项目及其visual studio 2005时代网站开发功能,以进行纯HTML5 html / css / javascript开发?

Can I use one of the ASP.NET 5 (DNX) Web Application templates (.xproj), and just delete all the C# stuff, to get a working pure HTML5 development template, and retain all the new javascript grunt/bower tooling? Or do I have to stick with Web Site (folder level) projects, and their visual studio 2005 era website development features, for pure HTML5 html/css/javascript development?

更新:如果投票意见的亲密选民会非常友好地指出我要求任何意见的地方,那就太棒了。我正在寻求帮助开发Visual Studio的模板,我相信这是关于主题的,而不是征求意见。要开发模板,您必须做出选择。哪一个将提供最完整的HTML5工具,包括grunt和bower以及完整的javascript语法高亮,jslint,bundle,minify等?

Update: If close voters who voted "opinion" based would be so kind enough as to point out where I call for any opinion, that'd be great. I'm asking for help DEVELOPING a template for Visual Studio, and I believe that is on topic and not at all a call for opinion. To develop a template you must make a choice. Which one will provide the most complete HTML5 tooling including grunt and bower and full javascript syntax highlighting, jslint, bundle, minify, etc?

在开发模板时,我的研究到目前为止显示:

When developing a template, my research so far shows that:


  • 耐心,蚱蜢,这是早期的事。 ASP .NET Core 1.0 刚刚发布,但不包含某些元素,包括用于基本纯HTML 5 Web项目开发的新的.xproj样式项目集(名称尚未公布,但让我们假设,它可能被称为核心页面),无论是什么,用于Microsoft Visual Studio的Pure HTML5开发的Microsoft特许经营重启要么尚不存在,要么处于内部开发的早期阶段。如果微软采取行动,我今天可以制作的模板可能会在三周或三个月内过时。

  • Patience, grasshopper, it's early days. ASP.NET Core 1.0 just released, but does not include certain elements, including a new .xproj style set of projects for basic pure HTML 5 web project development (name not yet even announced, but let's hypothesize, it might be called Core Pages), whatever it is, the Microsoft "franchise reboot" for Pure HTML5 Development with Microsoft Visual studio either doesn't exist yet, or is in early stages of internal development. Whatever template I could make today might be obsolete in three weeks or three months if Microsoft makes a move here.

目前,对于那些能够忍受它的人来说,文件 - >新网站工作正常,我没有找到任何技术记录的原因,你不能用它进行新的开发,只是微软的一个警告,它可能不是最好的选择,如果一个文件 - >新项目模板可以满足您的需求。您可以从ASP.NET Core 1.0今天的工作方式(及时自动重新编译,无需在ASP.NET Core中重建,将WebSite世界的核心功能最终进入WebApp世界)中看出它的新工具和dnx和dnvm中的新.NET核心功能最终将恢复自然平衡,我认为在过去的10年里,WebSite / WebApp二分法已经分裂了。还没有,但这是我从研究ASP.NET核心架构中理解的核心设计元素的一部分。

For now, for people who can live with it, File -> New Web sites works fine, and I haven't found any technical documented reason why you CAN'T use it for new development, just a caution from Microsoft that it might not be the best choice, if a File -> New Project template can meet your needs. You can see from the way that ASP.NET Core 1.0 today works (just in time automatic-recompile without rebuilding in ASP.NET Core brings a core feature of the WebSite world over into the WebApp world at last) that its new tooling and the new .NET Core features inside dnx and dnvm will finally "restore the Balance of Nature" that I feel has now been divided over the last 10 years by the WebSite/WebApp dichotomy. Not yet, but that's part of the core design elements I have understood from studying the ASP.NET Core architecture.

对于ExtJS,Visual Studio的Sencha Ext JS插件提供了一个File - > New Web Site选项,这很好用。我昨天晚上下载并测试了它,它工作正常。如果我想调用grunt或bower,或捆绑和缩小,或任何其他web-dev工作流任务,我也可以使用外部命令提示符窗口手动执行此操作。因此虽然它可能不像我想要的那样闪亮,但可以完成工作。 Ext JS插件提供完整的Ext类层次结构代码完成,以及纯HTML5(通过文件新网站)和HTML5 + ASP.NET(通过File New Project)的入门模板。在评估他们的插件时,我最初认为没有办法在visual studio中做一个纯HTML5应用程序,因为我完全没有意识到File New Website选项,并且认为(错误地)将这个VS区域视为已弃用。

For ExtJS, the Sencha Ext JS plugin for Visual Studio provides a File -> New Web Site option, and this works fine. I downloaded and tested it yesterday evening and it works fine. If I want to invoke grunt or bower, or bundle and minify, or any other web-dev workflow task, I can do so manually using an external command prompt window as well. So while it might not be as shiny as I was looking for, it's possible to get work done. The Ext JS plugin provides full Ext class hierarchy code-completion, and starter templates for both pure HTML5 (via file New Website) and HTML5+ASP.NET (via File New Project). When evaluating their plugin I initially thought there was NO way to do a pure HTML5 app inside visual studio because I was totally unaware of the File New Website option, and thought (incorrectly) of this area of VS as deprecated.

对于包含.NET的Angular SPA开发,有这个模板,看起来你可以使用它,如果你想做一个纯HTML5 SPA,就不要写任何ASP.NET服务器端。

For Angular SPA development INCLUDING .NET there is this template, and it appears you could use it and just not write any ASP.NET server side stuff if you wanted to do a pure HTML5 SPA.

我可能会建议从上面链接的角度SP开发模板开始,修改它以减去angular并插入ExtJS,或使用Sencha的IDE插件提供的ASP.NET 4.6 plus ExtJS模板,然后减去该模板中的所有ASP.NET代码。我还没有针对ASP.NET Core 1.0 .xproj世界的入门模板建议。

I would probably suggest starting with the angular SP development template linked above and modifying it to subtract angular and insert ExtJS, or using the ASP.NET 4.6 plus ExtJS template provided by Sencha's IDE plugin, and just subtracting all the ASP.NET code from that template. I don't yet have a starter template suggestion for the ASP.NET Core 1.0 .xproj world yet.

这应该是可能的,而且似乎很容易使用.NET Core和ASP.NET Core作为纯HTML5开发环境工具的关键部分。特别是dnx web是一种有用的本地开发方式,因为它比使用IIS Express更轻量级。使用DNX web(kestrel)作为纯HTML5的轻量级静态服务器,以及完整的Visual Studio 2015项目(网站或webapp)或仅使用现代网络编辑器来开发HTML5同样可行。 Visual Studio代码。

It should be possible, and seems quite easy to use .NET Core and ASP.NET Core as a key part of the tooling for a pure HTML5 development environment. In particular "dnx web" is a useful way of locally developing, as it is even more lightweight than using IIS Express. It should be equally feasible to develop for HTML5 with "DNX web" (kestrel) as the lightweight static server for pure HTML5, and either a full Visual Studio 2015 project (either website or webapp), or using just a modern web-editor like Visual Studio Code.

我希望其他开发人员仍然感到困惑,因为我是关于现在10年的分裂视觉工作室中关于新网站和新网络应用程序的人格问题最终可能会在隧道尽头看到一些亮点。

I hope that other developers who are still confused, as I was about the now-10-years-long split-personality issue in visual Studio with regards to New Web Site and New Web Application, may finally see some light at the end of the tunnel.

更新:2016年第4季度:实际上看起来VS 2015中的双向分裂人格问题将在VS 2016中变得更糟(目前预览为VS15)因为将有三种方式来打开项目,通过一个菜单项打开解决方案/ csproj,通过打开Web项目另一个,并通过第三个打开文件夹。

Update: Q4/2016: It actually looks like the two way split personality issues in VS 2015 will get worse in VS 2016 (Currently in preview as VS15) because there will be THREE ways to open a project, open solution/csproj via one menu item, open web project via another, and open folder via a third.