asp.net-core-mvc

asp.net Core 1.1 chunked responses

丶灬走出姿态 提交于 2020-01-01 11:45:10
问题 Hopefully, someone can enlighten me on the following. I have a client that will do a request to a controller endpoint (there is no view, c# to c# or even C++ later). That controller will have to send responses as it fetches them asynchronously as json (sends json1 to client, then json2, then json3 until it closes the connection or send a null terminated text or similar). The purpose is to stream the results back to the client so it can start processing while the server still works. My

ASP.NET 5 MVC6 Custom CSS & Javascript placing convention

北城余情 提交于 2020-01-01 11:35:11
问题 So I'm playing around with MVC6, and I've added bower.json & grunt.json, I've created my grunt tasks for generating my jQuery & bootstrap.css and its all sitting in the wwwroot folder as i expected. But what about things like my site.css & my main.js files, the files that I will add to for the project over time. What convention are people using when choosing a directory for this stuff? Are we to add a Content folder and drop it in? Is there something I'm missing, that i should also be using

ASP.NET 5 (vNext) Deployment via TFS 2015

Deadly 提交于 2020-01-01 10:04:53
问题 We're trying to work through the new tool chain for building and deploying an ASP.NET 5 (vNext) CoreCLR web site to a server cluster. Between the new compilation changes and the changes to TFS, I'm not sure how everything now gets built and deployed. The scenario is as follows: On-premise TFS for source control and build agent Targeting ASP.NET 5 under CoreCLR, hosted via IIS Questions are: Using TFS for continuous integration builds (and hopefully deployment to an on-premise IIS server), how

ASP.NET 5 (vNext) Deployment via TFS 2015

折月煮酒 提交于 2020-01-01 10:04:24
问题 We're trying to work through the new tool chain for building and deploying an ASP.NET 5 (vNext) CoreCLR web site to a server cluster. Between the new compilation changes and the changes to TFS, I'm not sure how everything now gets built and deployed. The scenario is as follows: On-premise TFS for source control and build agent Targeting ASP.NET 5 under CoreCLR, hosted via IIS Questions are: Using TFS for continuous integration builds (and hopefully deployment to an on-premise IIS server), how

How can Asp Net Core serve html static pages?

南笙酒味 提交于 2020-01-01 09:55:44
问题 I have recently started an Asp .Net Core app. Later I wanted to integrate it with Angular, but first I wanted a mechanism that will 'replace' cshtml with html . If I change extension from cshtml to html I get this 'InvalidOperationException: The view 'Index' was not found'. Also I tried in Startup app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); but it also didn't work. Optional is to integrating cshtml

Using multiple connection strings

99封情书 提交于 2020-01-01 09:45:48
问题 Info I have multiple projects in my Solution, of which one is the DAL and the other is an ASP.NET MVC6 project. Since the MVC6 project is also the startup project I need to add my connection string there. I saw this solution, but it is not accepted, nor does it work. My Try appsettings.json "Data": { "DefaultConnection": { "ConnectionString": "Server=.\\SQLEXPRESS;Database=Bar;Trusted_Connection=True;MultipleActiveResultSets=true" }, "FooBar": { "ConnectionString": "Server=.\\SQLEXPRESS

Using multiple connection strings

社会主义新天地 提交于 2020-01-01 09:45:42
问题 Info I have multiple projects in my Solution, of which one is the DAL and the other is an ASP.NET MVC6 project. Since the MVC6 project is also the startup project I need to add my connection string there. I saw this solution, but it is not accepted, nor does it work. My Try appsettings.json "Data": { "DefaultConnection": { "ConnectionString": "Server=.\\SQLEXPRESS;Database=Bar;Trusted_Connection=True;MultipleActiveResultSets=true" }, "FooBar": { "ConnectionString": "Server=.\\SQLEXPRESS

Where is HtmlEncode in Asp.NET 5

一笑奈何 提交于 2020-01-01 08:48:10
问题 I have a custom IHtmlHelper extension method that uses TagBuilder and returns an HtmlString . I can no longer pass tagBuiler.ToString() to the HtmlString constructor as that just returns the typename now. I see I can use the tabBuiler.WriteTo(TextWriter, IHtmlEncoder) method but I don't know exactly how to get my hands on an object that implments IHtmlEncoder . I see encoders in both System.Text.Encodings.Web and Microsoft.Framework.WebEncoders . But the types in the two namespace don't seem

Where is HtmlEncode in Asp.NET 5

假如想象 提交于 2020-01-01 08:47:08
问题 I have a custom IHtmlHelper extension method that uses TagBuilder and returns an HtmlString . I can no longer pass tagBuiler.ToString() to the HtmlString constructor as that just returns the typename now. I see I can use the tabBuiler.WriteTo(TextWriter, IHtmlEncoder) method but I don't know exactly how to get my hands on an object that implments IHtmlEncoder . I see encoders in both System.Text.Encodings.Web and Microsoft.Framework.WebEncoders . But the types in the two namespace don't seem

Asp.Net core “remember me” persistent cookie not works after deploy

我们两清 提交于 2020-01-01 08:33:49
问题 I've built an MVC Core (Framework) application and I use Identity to login. When I click "Remember me" option all is ok on my develop machine, but after deploy on server machine, "remember me" doesn't maintain login after 30 minutes. I tried to check if cookie expiry date is set and seems to be ok, also on server machine the cookie seems well set. You can see my cookies detail in following image: Can anyone help me to solve this issue? Thanks in advance for your reply :) EDIT: As required by