Entity Framework Timeouts

There is a known bug with specifying default command timeout within the EF connection string. http://bugs.mysql.com/bug.php?id=56806 Remove the value from the connection string and set it on the data context object itself. This will work if you remove the conflicting value from the connection string. Entity Framework Core 1.0: this.context.Database.SetCommandTimeout(180); Entity Framework 6: this.context.Database.CommandTimeout = … Read more

Response Content type as CSV

Using text/csv is the most appropriate type. You should also consider adding a Content-Disposition header to the response. Often a text/csv will be loaded by a Internet Explorer directly into a hosted instance of Excel. This may or may not be a desirable result. Response.AddHeader(“Content-Disposition”, “attachment;filename=myfilename.csv”); The above will cause a file “Save as” dialog … Read more

Can I automatically increment the file build version when using Visual Studio?

In visual Studio 2008, the following works. Find the AssemblyInfo.cs file and find these 2 lines: [assembly: AssemblyVersion(“1.0.0.0”)] [assembly: AssemblyFileVersion(“1.0.0.0”)] You could try changing this to: [assembly: AssemblyVersion(“1.0.*”)] [assembly: AssemblyFileVersion(“1.0.*”)] But this won’t give you the desired result, you will end up with a Product Version of 1.0.* and a File Version of 1.0.0.0. Not … Read more

“The Controls collection cannot be modified because the control contains code blocks”

First, start the code block with <%# instead of <%= : <head id=”head1″ runat=”server”> <title>My Page</title> <link href=”https://stackoverflow.com/questions/778952/css/common.css” rel=”stylesheet” type=”text/css” /> <script type=”text/javascript” src=”<%# ResolveUrl(“~/javascript/leesUtils.js”) %>”></script> </head> This changes the code block from a Response.Write code block to a databinding expression. Since <%# … %> databinding expressions aren’t code blocks, the CLR won’t complain. Then … Read more

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated

Looks like you have a query that is taking longer than it should. From your stack trace and your code you should be able to determine exactly what query that is. This type of timeout can have three causes; There’s a deadlock somewhere The database’s statistics and/or query plan cache are incorrect The query is … Read more

Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state

For me, the solution (workaround) is to turn off JavaScript debugging on Chrome, which I believe is a new feature introduced in VS 2017. Go to Tools > Options > Debugging > General and turn off the setting for Enable JavaScript Debugging for ASP.NET (Chrome and IE). This is a known issue already, and seems … Read more

ASP.NET Identity – HttpContext has no extension method for GetOwinContext

ARGH! I found it… I didn’t have an extra package, called Microsoft.Owin.Host.SystemWeb Once i searched and installed this, it worked. Now – i am not sure if i just missed everything, though found NO reference to such a library or package when going through various tutorials. It also didn’t get installed when i installed all … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)