我一直在VS2005中使用本地連接訪問數據庫的項目。「無法識別的配置節connectionStrings」。
在過去的一週中,我安裝了.NET Framework 3.5,以用於不同的項目以及VS6。
我回到我的VS2005的應用程序,突然有很大的問題:
在設計任何類利用我的OLEDB連接表明這一點:
Unable to cast object of type 'System.Configuration.DefaultSection' to type 'System.Configuration.ConnectionStringsSection'. Hide
at System.Configuration.Configuration.get_ConnectionStrings() at Microsoft.VisualStudio.Shell.Design.Serialization.ConfigurationHelperService.ReadConnectionStrings(String configFileName, DocData configDocData, String prefix) at Microsoft.VisualStudio.Editors.SettingsDesigner.AppConfigSerializer.Deserialize(DesignTimeSettings Settings, String SectionName, DocData AppConfigDocData, MergeValueMode mergeMode, IUIService UIService) at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.LoadSettings(String fileName) at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.BuildType() at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.GetObjectType() at Microsoft.VisualStudio.Shell.Design.GlobalType.get_ObjectType() at Microsoft.VisualStudio.Shell.Design.GlobalObject.GetHashCode() at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GlobalKey.GetHashCode() at System.Collections.Generic.ObjectEqualityComparer
1.GetHashCode(T obj) at System.Collections.Generic.Dictionary
2.FindEntry(TKey key) at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects(Type baseType) at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects() at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetTypeFromGlobalObjects(String name, Boolean throwOnError, Boolean ignoreCase) at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(ITypeResolutionService trs, String name, Dictionary2 names) at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStatementTable(IDesignerSerializationManager manager, IDictionary table, Dictionary
2 names, CodeStatementCollection statements, String className) at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration) at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
而當我跑的應用程序,我遇到以下異常啓動時:
"Unrecognized configuration section connectionStrings."
在網上找,這些問題似乎普遍涉及到建在VS2005的東西和部署.NET 1.1框架;但是這全部作爲VS本地內的Windows窗體應用程序運行(不在IIS上)。我試過卸載並重新安裝VS2K5無濟於事。
有什麼想法? 謝謝, 馬特
感謝您的答覆! 我不相信這是這種情況,我的app.config如下: <?xml version =「1.0」encoding =「utf-8」?> <結構> configSections> 節點 <添加名稱= 「Mockups.Properties.Settings.MockupDSConnectionString」 的connectionString =「提供商= Microsoft.Jet.OLEDB.4.0;數據源= | DataDirectory | \ MockupDS.mdb「 providerName =」System.Data.OleDb「/> connectionStrings> configuration> –
2009-11-24 14:03:59
我認爲存在某些配置錯誤 - 不幸的是,卸載/安裝的東西似乎無法解決它。 即使我嘗試創建一個新的DataSource連接 - 在連接嚮導中 - 我選擇OLE DB連接,選擇.mdb,然後單擊「確定」,彈出窗口顯示「目標拋出了異常的調用。「就是這樣! 非常令人沮喪...... – 2009-11-24 14:04:36
我正在敲我的腦袋,試圖找出爲什麼我的App.config不適用於某些自定義類型 - 這是問題所在。謝謝! – dmo 2010-03-25 19:49:41