繁体   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