2011-08-07 2 views
1

, Hi,La chaîne n'a pas été reconnue comme étant un DateTime valide, asp.net

J'ai un site Web asp.net et C#.

Dans le code asp J'utilise

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

quand je lance mon projet, je reçois cette erreur:

String was not recognized as a valid DateTime.

Je n'utilise pas des choses DataTime, sur mon site.

Ensuite, lorsque j'effectue l'actualisation de la page, l'erreur disparaît.

Stack Trace:

 
[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 

Que peut-être la question?

+2

Quelle est la trace de la pile? – SLaks

+1

Utilisez-vous 'DateTime.Parse (someString)'? Si oui, publiez ce code, s'il vous plaît. –

+0

@ DotNET Ninja, je n'utilise pas que tout était ... – Ovi

Répondre

8

Vous référencez une bibliothèque avec une [TypeLibraryTimeStampAttribute] à laquelle une date non valide lui a été transmise.

Trouvez cette bibliothèque et corrigez-la ou supprimez-la.

En général, c'est une mauvaise idée d'utiliser des bibliothèques WinForms dans ASP.Net.

0

supprimer tous les fichiers AxInterop. *. Dll du dossier bin de l'application Web

Questions connexes