asp.net-4.5

Upgrading to ASP.NET 4.5/MVC 4 forms authentication fails

泪湿孤枕 提交于 2019-11-26 16:08:35
问题 I've just downoaded a VS 2012 along with ASP.NET 4.5 and MVC 4.0 and was kicking the tires with a sample app and found that the forms authentication that works perfectly with ASP.NET 4.0/MVC 3 no longer seems to work with the latest release. When I make a call to the Login function in the action controller, the WebSecurity.Login call fails: public ActionResult Login(LoginModel model, string returnUrl) { if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie:

Understanding context in C# 5 async/await

我只是一个虾纸丫 提交于 2019-11-26 15:29:03
问题 Am I correct that async/await itself has nothing to do with concurrency/parallelism and is nothing more than continuation-passing style (CPS) implementation? And the real threading is performed by SynchronizationContext instance that await passes/restores? If that is correct I have the following question about SynchronizationContext : it guarantees that a continuation will be executed on the same thread. However, are there any guaranties that the thread's context information is persisted? I

Writing to ZipArchive using the HttpContext OutputStream

依然范特西╮ 提交于 2019-11-26 13:56:24
问题 I've been trying to get the "new" ZipArchive included in .NET 4.5 ( System.IO.Compression.ZipArchive ) to work in a ASP.NET site. But it seems like it doesn't like writing to the stream of HttpContext.Response.OutputStream . My following code example will throw System.NotSupportedException: Specified method is not supported as soon as a write is attempted on the stream. The CanWrite property on the stream returns true. If I exchange the OutputStream with a filestream, pointing to a local

IIS_IUSRS and IUSR permissions in IIS8

江枫思渺然 提交于 2019-11-26 01:41:34
问题 I\'ve just moved away from IIS6 on Win2003 to IIS8 on Win2012 for hosting ASP.NET applications. Within one particular folder in my application I need to Create & Delete files. After copying the files to the new server, I kept seeing the following errors when I tried to delete files: Access to the path \'D:\\WebSites\\myapp.co.uk\\companydata\\filename.pdf\' is denied. When I check IIS I see that the application is running under the DefaultAppPool account, however, I never set up Windows