簡體   English   中英

在WPF中加載DataGrid時出錯

[英]Error in loading datagrid in WPF

我想更改應用程序的exe名稱。 因此,我將程序集名稱從BoltDataCalculation更改為其他名稱“ BoltDataValidation”。 但是,wpf應用程序中的datagrid在運行時加載時顯示錯誤。 請幫助我解決此異常。 下面是錯誤:

System.IO.FileNotFoundException: Could not load file or assembly 'BoltDataCalculation, Culture=neutral' or one of its dependencies. The system cannot find the file specified.
File name: 'BoltDataCalculation, Culture=neutral'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at System.Windows.Navigation.BaseUriHelper.GetLoadedAssembly(String assemblyName, String assemblyVersion, String assemblyKey)
   at MS.Internal.AppModel.ResourceContainer.GetResourceManagerWrapper(Uri uri, String& partName, Boolean& isContentFile)
   at MS.Internal.AppModel.ResourceContainer.GetPartCore(Uri uri)
   at System.IO.Packaging.Package.GetPartHelper(Uri partUri)
   at System.IO.Packaging.Package.GetPart(Uri partUri)
   at System.Windows.Application.GetResourceOrContentPart(Uri uri)
   at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
   at System.Windows.Application.LoadComponent(Uri resourceLocator)
   at FirstFloor.ModernUI.Windows.DefaultContentLoader.LoadContent(Uri uri)
   at FirstFloor.ModernUI.Windows.DefaultContentLoader.<>c__DisplayClass1.<LoadContentAsync>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

=== Pre-bind state information ===
LOG: User = Manish-PC\Manish
LOG: DisplayName = BoltDataCalculation, Culture=neutral
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: BoltDataCalculation, Culture=neutral | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/Manish/Desktop/Indepth work/manish/BoltDataCalculation/BoltDataCalculation/BoltDataCalculation/bin/Release/
LOG: Initial PrivatePath = NULL
Calling assembly : PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Manish\Desktop\Indepth work\manish\BoltDataCalculation\BoltDataCalculation\BoltDataCalculation\bin\Release\InDepthBoltValidation.vshost.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/Manish/Desktop/Indepth work/manish/BoltDataCalculation/BoltDataCalculation/BoltDataCalculation/bin/Release/BoltDataCalculation.DLL.
LOG: Attempting download of new URL file:///C:/Users/Manish/Desktop/Indepth work/manish/BoltDataCalculation/BoltDataCalculation/BoltDataCalculation/bin/Release/BoltDataCalculation/BoltDataCalculation.DLL.
LOG: Attempting download of new URL file:///C:/Users/Manish/Desktop/Indepth work/manish/BoltDataCalculation/BoltDataCalculation/BoltDataCalculation/bin/Release/BoltDataCalculation.EXE.
LOG: Attempting download of new URL file:///C:/Users/Manish/Desktop/Indepth work/manish/BoltDataCalculation/BoltDataCalculation/BoltDataCalculation/bin/Release/BoltDataCalculation/BoltDataCalculation.EXE.

根據日志,您似乎尚未使用新程序集的名稱更新XAML中使用的URI。

更新項目中的所有PACK URI以引用新的程序集名稱。

我同意Rohit的意見,如果那行不通,請嘗試首先清潔您的解決方案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM