编译错误:蜱必须DateTime.MinValue.Ticks和DateTime.MaxValue.Ticks之间。参数名:蜱 [英] Compile Error: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks
问题描述
我有一个Visual Studio 2008解决方案,当我建,返回以下错误:
I have a Visual Studio 2008 solution that when I build, returns the following error:
Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks
有是错误没有参考文件/行/列。成为作为解决方案建立在年底很令人沮丧,但我不能调试。
There is no reference file/line/column in the error. Becoming quite frustrating as the solution builds in the end, however I cannot debug.
在该溶液中,没有参考/使用到DateTime.MinValue.Ticks在所有...
In the solution, there is no reference/using to DateTime.MinValue.Ticks at all...
编辑:
有2只在我的解决方案,以蜱引用,也不那些导致该问题。
There are only 2 references to ticks in my solution, and neither of those are causing the issue.
有与无的DateTime构造问题无论是。我不相信这是相关的DateTime或蜱的。
There are no constructor issues with DateTime either. I do not believe it is related to DateTime or ticks at all.
我发现了一个类似的参考的地方竟然是在解决方案中,它没有一个日期修改的值已损坏的图片文件。这不是我的影响,虽然。
I have found a similar reference where it turned out to be a corrupt image file in the solution, where it did not have a date-modified value. This is not affecting mine though.
推荐答案
该错误消息来自的DateTime
构造需要很长的价值。
The error message comes from the DateTime
constructor that takes a long value.
在某处,code要创建从一个恒定值datetime值,从而使实际创作是在编译时,而不是运行时完成。该值超出范围的构造。
Somewhere in your code you are creating a DateTime value from a constant value, so that the actual creation is done at compile time rather than runtime. That value is out of range for the constructor.
code像这样给出了相同的异常:
Code like this gives the same exception:
public static DateTime startTime = new DateTime(-1);
然而,异常发生在运行时间。为了得到它在编译时就可能有在您的标记code,就像在服务器控件的参数值。
However, the exception happens at run time. To get it at compile time there is probably something in your markup code, like an argument value in a server control.
这篇关于编译错误:蜱必须DateTime.MinValue.Ticks和DateTime.MaxValue.Ticks之间。参数名:蜱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!