Tag:asp.net

  • Hide the version of asp.net MVC in the HTTP response header

    Time:2019-11-22

    By default, the asp.net MVC website will add the version number of asp.net MVC currently used in the HTTP response header. If you use the developer tool to view the HTTP request response connected to the asp.net MVC website, you can see an “x-aspnetmvc-version” HTTP response header in the response header, which will disclose the […]

  • . net core single file publishing static compilation AOT corert method details

    Time:2019-11-22

    Preface This article mainly introduces the static compilation of AOT corert for. Net core single file publishing, which packages the. Net core application into an executable file and contains the runtime. Support windows, MacOS and Linux x64 w / ryujit CodeGen. Sample project: https://github.com/dotnet/corert/tree/master/samples/WebApi Here’s the actual experience. First, make sure to install the C […]

  • JSON mandatory lowercase property name in asp.net MVC

    Time:2019-11-21

    First, you need to reference newtonsoft.json using Newtonsoft.Json; using Newtonsoft.Json.Serialization; Then convert the object Model.JsonResult jsonResult = new Model.JsonResult { State = 200, Message = “success”, Data = dt.ToList() }; string json = JsonConvert.SerializeObject( jsonResult, Formatting.Indented, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); JSON string output { “message”: “success”, “state”: 200, “data”: [], “script”: […]

  • Complete steps of asp.net core and NLog integration

    Time:2019-11-21

    Preface I always like the simplicity and extensibility of NLog, so I am going to replace the default log provider provided by asp.net core with NLog. NLog is a cross platform. Net logging component. NLog complies with BSD license, which allows commercial application and full open source code. Anyone can use it for free and […]

  • Detailed explanation of. Net core2.0 log component log4net and NLog simple performance test

    Time:2019-11-20

    Simple performance test of log4net and NLog in. Net core Compare the file write performance of log4net and NLog (. NETCORE environment). If there is any error in the code and configuration, please criticize and correct it. testing environment Development tool: Vsual studio 2017 15.3 Framework version:. Net core 2.0 Operating system: windows10 enterprise 1703 […]

  • [open source]. NETCORE websocket instant messaging component — imcore

    Time:2019-11-19

    Imcore uses websocket protocol to implement simple, high-performance, cluster instant messaging components, supporting many practical functions such as point-to-point communication, group chat communication, online and offline event messages. Quick Start dotnet add package ImCore IM server public void Configure(IApplicationBuilder app) { app.UseimServer(new imServerOptions { Redis = new CSRedis.CSRedisClient(“127.0.0.1:6379,poolsize=5”), Servers = new [] {“127.0.0.1:6001”}, // cluster […]

  • . net core 2.0 how to generate a complete instance of picture verification code

    Time:2019-11-19

    Preface Picture verification code is an indispensable function in our daily development. Recently, we have met this requirement in our work. So let’s share the implementation method to you. Let’s have a look at the detailed introduction. . net core 2.0 generate picture captcha Nuget package import: zkweb.system.drawing, as follows: The code example is as […]

  • Steps of using docker to run asp.net core 2.1

    Time:2019-11-16

    1. Create a new asp.net core 2.1 project Then run the project to make sure that the project we just created works properly. 2. Write dockerfile Create a new text file namedDockerfile FROM microsoft/dotnet:2.1-aspnetcore-runtime WORKDIR /app COPY . . EXPOSE 80 ENTRYPOINT [“dotnet”, “AspNetCore.Docker.dll”] Here we need to use the official image:microsoft/dotnet:2.1-aspnetcore-runtime If you want […]

  • The method of parameter verification using fluent validate in. Net web API

    Time:2019-11-15

    Preface This article mainly introduces the related content of. Net web API using fluent validate parameter validation. I won’t say much next. Let’s take a look at the detailed introduction. The method is as follows Install fluent validate Please install the version of fluentvalidation.webapi in asp.net web API Create a model that needs to be […]

  • . net / asp.net routing

    Time:2019-11-14

    1] Introduction This article makes us happy to learn the core object model routing module in asp.net. Why is it happy? Because routing is based on the familiar asp.net pipeline model, it’s much easier than other unfamiliar concepts, but it’s not important to be familiar with them once and twice; Asp.net routing system is the […]

  • Asp.net MVC how to use unity to implement IOC

    Time:2019-11-10

    Why is this article Recently, I used IOC in asp.net MVC project, and chose unity as container component of dependency injection. I found related articles on the Internet and simply implemented dependency injection. However, I wanted to register container injection in the way of file configuration, and found that the implementation method of related articles […]

  • In depth explanation of. Net core cores Middleware

    Time:2019-11-5

    Homology policy and cross domain resource sharing 1. Homology strategy Homology policy, which is a famous security policy proposed by Netscape. Now all browsers that support JavaScript will use this strategy. The so-called homology refers to the same domain name, protocol and port. 1.1, purpose It is mainly to ensure the security of user information […]