gpt4 book ai didi

c# - 字符串未被识别为有效的 DateTime,asp.net

转载 作者:太空宇宙 更新时间:2023-11-03 18:15:33 25 4
gpt4 key购买 nike

,你好,

我有一个 asp.net 和 c# 网站。

在我使用的asp代码中

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager>

当我运行我的项目时,我得到这个错误:

String was not recognized as a valid DateTime.

我没有在我的网站上使用任何 dataTime 东西。

然后,当我刷新页面时,错误消失了。

堆栈跟踪:

 [FormatException: String was not recognized as a valid DateTime.]   System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +3610514   System.Windows.Forms.TypeLibraryTimeStampAttribute..ctor(String timestamp) +49   System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) +0   System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs) +46   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +529   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +103   System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit) +33   System.Web.UI.AssemblyCache.GetAjaxFrameworkAssemblyAttribute(Assembly assembly) +76   System.Web.UI.ScriptManager.get_DefaultAjaxFrameworkAssembly() +388   System.Web.UI.ScriptManager..ctor() +26   ASP.newpipe_aspx.__BuildControlScriptManager1() in c:\Documents and Settings\Berzon\Desktop\Kinor\kWebGUI\NewPipe.aspx:17   ASP.newpipe_aspx.__BuildControlBodyContent(Control __ctrl) in c:\Documents and Settings\Berzon\Desktop\Kinor\kWebGUI\NewPipe.aspx:16   System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12   System.Web.UI.MasterPage.InstantiateInContentPlaceHolder(Control contentPlaceHolder, ITemplate template) +87   ASP.site_master.__BuildControlMainContent() in c:\Documents and Settings\Berzon\Desktop\Kinor\kWebGUI\Site.master:55   ASP.site_master.__BuildControlfullPage() in c:\Documents and Settings\Berzon\Desktop\Kinor\kWebGUI\Site.master:16   ASP.site_master.__BuildControlBody1() in c:\Documents and Settings\Berzon\Desktop\Kinor\kWebGUI\Site.master:15   ASP.site_master.__BuildControlTree(site_master __ctrl) in c:\Documents and Settings\Berzon\Desktop\Kinor\kWebGUI\Site.master:1   ASP.site_master.FrameworkInitialize() in c:\Documents and Settings\Berzon\Desktop\Kinor\kWebGUI\Site.master.cs:912308   System.Web.UI.UserControl.InitializeAsUserControlInternal() +35   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8893254   System.Web.UI.Page.get_Master() +54   System.Web.UI.Page.ApplyMasterPage() +15   System.Web.UI.Page.PerformPreInit() +45   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +328

可能是什么问题?

最佳答案

您正在使用传递给它的无效日期的 [TypeLibraryTimeStampAttribute] 引用一个库。

找到那个库并修复或删除它。

一般来说,在 ASP.Net 中使用 WinForms 库是个坏主意。

关于c# - 字符串未被识别为有效的 DateTime,asp.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6972997/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com