2011-08-07 77 views
1

,您好,字符串未被識別爲有效的DateTime,asp.net

我有一個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 

什麼可以是問題?

+2

什麼是堆棧跟蹤? – SLaks

+1

你使用'DateTime.Parse(someString)'?如果是這樣,請發佈此代碼。 –

+0

@ DotNET忍者,我沒有使用任何... – Ovi

回答

8

您正在引用一個包含[TypeLibraryTimeStampAttribute]的庫,該庫具有傳遞給它的無效日期。

找到該庫並修復或刪除它。

通常,在ASP.Net中使用WinForms庫是一個壞主意。

0

從web應用程序的bin文件夾中刪除所有AxInterop。* .dll文件

相關問題