Comments (8)
This looks like a datetime issue. Miniblog should check to see if the LastModified date of a blog post is newer than DateTime.UtcNow. If so, it should fall back to DateTime.UtcNow. I'll take a look
from miniblog.
Please try with the latest source code. I just committed a fix. Since I can't repro it locally, could you please verify that the fix worked?
from miniblog.
Same error. What version of Windows and .Net are you testing on?
On Mon, Apr 21, 2014 at 6:35 PM, Mads Kristensen
[email protected]:
Please try with the latest source code. I just committed a fix. Since I
can't repro it locally, could you please verify that the fix worked?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/74#issuecomment-40984965
.
from miniblog.
I'm on 4.5. The error is a datetime issue. It appears that it tries to set the last modified header to be in the future and that's what causes the exception. Are you hosting on Azure? If so, can you attach the remote debugger from Visual Studio 2013 in the Server Explorer. Then set a breakpoint and see what the values are compared to DateTime.UtcNow?
from miniblog.
I'm not using Azure, just IIS. The value of lastModified appears to be DateTime.UtcNow. Here is the stacktrace from Visual Studio. However, the exception actually occures in Index.cshtml at line 59. I moved lastModified = DateTime.UtcNow < lastModified ? DateTime.UtcNow : lastModified;
to just before and it doesn't help.
System.ArgumentOutOfRangeException was unhandled by user code
HResult=-2146233086
Message=Specified argument was out of the range of valid values.
Parameter name: utcDate
Source=System.Web
ParamName=utcDate
StackTrace:
at System.Web.HttpCachePolicy.UtcSetLastModified(DateTime utcDate)
at System.Web.HttpCachePolicy.SetLastModified(DateTime date)
at Blog.SetConditionalGetHeaders(DateTime lastModified, HttpContextBase context)
at ASP._Page_Index_cshtml.Execute() in c:\inetpub\wwwroot\MiniBlog\Index.cshtml:line 59
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext)
InnerException:
from miniblog.
What timezone is your Windows machine running IIS using?
from miniblog.
I'm still getting my head around this, but I think I found a fix. Changed line 59 on Index.cshtml to Blog.SetConditionalGetHeaders(lastModified.ToLocalTime(), Context);
based on information from http://www.hanselman.com/blog/BackToBasicsDaylightSavingsTimeBugsStrikeAgainWithSetLastModified.aspx that should be completely unrelated.
I was able to create a new post and the timestamp on the page is correct.
from miniblog.
Great. Send a PR :)
from miniblog.
Related Issues (20)
- How pubDate will remain same after opening/editing in WLW HOT 2
- Picture aspect ratio with WLW: widht and height is set HOT 1
- How to use MiniBlog HOT 8
- Support Keywords/Tags HOT 2
- [Question] Syntax highlighting HOT 4
- Hosting two blogs at different base URLs with the same codebase?
- Admin Login HOT 2
- asp.net core version ? Http2 friendly version ? (static domain not needed anymore) HOT 1
- RTL Support
- A safer way to send email HOT 1
- Is there way to run this project without using IIS URL rewrite module? HOT 1
- Cant save the posts
- Can't Insert Image HOT 1
- hosting as application within iis application
- Memory Consumption - 250mb HOT 2
- Is there a way to use it with .NET framework (i.e. MVC 5)? HOT 2
- All post is not loaded on startup [Fix]
- DateTime UTC and local mismatch HOT 1
- Next and Previous buttons not displayed when there are more than 4 posts
- MiniBlog does not work with .NET 6 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miniblog.