https://docs.microsoft.com/zh-cn/aspnet/core/…
这两天把一个 asp.net core 1.1 的项目迁移到了 asp.net core 2.0 preview 2 ,在这篇随笔中记录一下. 如果项目在有 global.json 文件,需要删除或修改为 .net 2.0 preview 2 的 sdk 版本号. 对于类库项目的 .csproj,需要把 TagetFramework 改为 netstandard2.0 ,比如 <PropertyGroup> <TargetFramework>netstandard1.6</T…
原因 由于Visual Studio 2017在保存chtml时,文本格式非utf-8,所以导致中文会出现乱码情况. 解决办法 在工具->扩展与更新中添加插件"ForceUTF8 (with BOM)" 安装后重启Visual Studio 2017,再编辑相关chtml文档,中文不会再出现乱码.…
https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/hosting?tabs=aspnetcore2x…
参考:https://jingyan.baidu.com/article/6079ad0e3e212168fe86db75.html 在Startup.cs的Configure添加 app.UseFileServer(); 示例: public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { if (env.IsDevelopment()) { app…
指定一个网站的default page是很容易的事情.譬如IIS Management中,可以通过default page来指定,而默认的index.html, index.htm之类,则早已经被设置为默认了. 另外一种对ASP.NET网站行之有效的方法是,修改web.config. 譬如: <system.webServer> <defaultDocument> <files> <clear /> <add value="index.htm…
from:https://damienbod.com/2015/12/13/asp-net-5-mvc-6-api-documentation-using-swagger/ 代码生成工具: https://github.com/NSwag/NSwag This article shows how to document your ASP.NET Core 1.0 MVC API using Swagger with Swashbuckle. Per default, it does not us…
参考地址,官网:https://docs.microsoft.com/zh-cn/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-2.2&tabs=visual-studio 与https://www.jianshu.com/p/349e130e40d5 当一个WebApi完成之后,书写API文档是一件非常头疼的事,因为不仅要写得清楚,能让调用接口的人看懂,又是非常耗时耗力的一件事.在之前的一篇随笔中(…
github:https://github.com/domaindrivendev/Ahoy 之前文章有介绍在ASP.NET WebAPI 中使用Swagger生成文档,ASP.NET Core 1.0中同样也支持. 依赖包 "dependencies": { "Swashbuckle.SwaggerGen": "6.0.0-rc1-final", "Swashbuckle.SwaggerUi": "6.0.0-rc…
升级文档: Migrating from DNX to .NET Core Migrating from ASP.NET 5 RC1 to ASP.NET Core 1.0 RC2 Migrating your Entity Framework Code from RC1 to RC2 ASP.NET Core 1.0 RC2 发布:解读发布:.NET Core RC2 and .NET Core SDK Preview 1 之前,使用 ASP.NET 5 RC1 开发了一个项目,并且这个项目已…