1,安装Microsoft.AspNetCore.Mvc.Versioning NET Core Mvc中,微软官方提供了一个可用的Api版本控制库Microsoft.AspNetCore.Mvc.Versioning. 2,修改Startup类 这里我们需要在Startup类的ConfigureService方法中添加以下代码. // This method gets called by the runtime. Use this method to add services to the c…
1.使用VS 2015 新建了一个Core API项目,然后把他的依赖升级到最新(我机器VS 2015默认的包都是rc版本),然后publish. 2.在publish目录的同级目录下,新建Dockerfile,没有后缀,里面内容如下: FROM microsoft/dotnet:latest WORKDIR /root # Copy the app COPY PublishOutput /root/ # Configure the listening port to #ENV ASPNETCO…
事由: 这两天mentor给我布置了个任务让我用BenchmarkDotNet工具去测试一下同一个API 用同步和异步方法写性能上有什么差别. 顺带提一下: 啊啊啊啊 等我仔细看文档的时候文档 发现它让我用Release的模式去运行benchmark. emmm...其实我之前一直在用Debug模式调试.. 所以各位在运行的时候,The best way is build our benchmark in the Release mode and run it from the command…