c# – XamlParseException:无法加载文件或程序集“ResourceLibrary,…”或其依赖项之一.该系统找不到指定的文件

System. Windows.Markup.XamlParseExceptionoccurred

PresentationFramework.dll中出现’System.Windows.Markup.XamlParseException’类型的第一次机会异常

附加信息:’Set property’System.Windows.ResourceDictionary.Source’引发了一个异常.行号“21”和行位置“6”.

“无法加载文件或程序集’ResourceLibrary,Culture = neutral’或其中一个依赖项.系统无法找到指定的文件.”:“ResourceLibrary,Culture = neutral”

=== Pre-bind state information ===
LOG: DisplayName = ResourceLibrary,Culture=neutral
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: ResourceLibrary,Culture=neutral | Domain ID: 2
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/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\QTAgent32.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/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/ResourceLibrary/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/ResourceLibrary/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PublicAssemblies/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PublicAssemblies/ResourceLibrary/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/DataCollectors/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/DataCollectors/ResourceLibrary/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/DataCollectors/x86/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/DataCollectors/x86/ResourceLibrary/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/DataCollectors/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/DataCollectors/ResourceLibrary/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/DataCollectors/x86/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/DataCollectors/x86/ResourceLibrary/ResourceLibrary.DLL.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/ResourceLibrary/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/ResourceLibrary/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PublicAssemblies/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PublicAssemblies/ResourceLibrary/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/DataCollectors/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/DataCollectors/ResourceLibrary/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/DataCollectors/x86/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/DataCollectors/x86/ResourceLibrary/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/DataCollectors/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/DataCollectors/ResourceLibrary/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/DataCollectors/x86/ResourceLibrary.EXE.
LOG: Attempting download of new URL file:///C:/Users/me/Documents/projects/Autom/git/Autom/VisCong/VisConf_Tests/bin/Debug/PrivateAssemblies/DataCollectors/x86/ResourceLibrary/ResourceLibrary.EXE.

解决方法

这个问题只是对我自己以及在寻找这个问题的解决方案时来到这里的任何人的参考.

引用中的“复制本地”设置为“True”,但DLL未复制到构建文件夹.

由于我仅在XAML中使用此资源库,因此我必须添加一个using语句:

using ResourceLibrary;

在引用代码中(实际上,调用引用代码的代码,可以是应用程序或单元测试)

这使得DLL在目标构建目录中创建.

编辑:

有时即使使用ResourceLibrary也不起作用.解决方案是在ResourceLibrary的代码隐藏中创建一些空的静态方法:

namespace ResourceLibrary {
    public static class ReferencePoint {
        public static ReferToMe() {}
    }
}

并从引用代码调用它:

ReferencePoint.ReferToMe();

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


1 在Visual Studio 中创建一个Asp.NET WebApi 项目,项目名:Com.App.SysApi(本例创建的是 .net 4.5 框架程序) 2 打开Nuget 包管理软件,查找 swagger 安装Swashbuckle 组件 3 开启项目的XML注释位置(选中项目Com.Ap
using ImpromptuInterface; using System; using System.Dynamic; namespace ConsoleApp2 { class Program { static void Main(string[] args) { dynamic expand
https://blog.csdn.net/michaelgong/article/details/43148597
C#11添加了文件作用域类型功能:一个新的file修饰符,可以应用于任何类型定义以限制其只能在当前文件中使用。 这样,我们可以在一个项目中拥有多个同名的类。 通过下面的项目显示,该项目包含两个名为Answer的类。 文件File1.cs中 namespace ConsoleApp11 { file
在.NET中Newtonsoft.Json(Json.NET)是我们常用来进行Json序列化与反序列化的库。 而在使用中常会遇到反序列化Json时,遇到不规则的Json数据解构而抛出异常。 Newtonsoft.Json 支持序列化和反序列化过程中的错误处理。 允许您捕获错误并选择是处理它
设置允许跨域访问的网址--> 设置预检有效时间--> -->
先来看一点实例,两个类之间的映射。 首先定义两个类Source与DTOSource: Source与DTOSource字段完全相同,来看看它俩如何通过AutoMapper转换,代码很简单。 第一步建立Source到DTOSource之间的映射,初始化一个Source实例后,来看下执行结果: 执行完成
C#中提供了IObservable<T>接口和IObserver<T>接口来实现观察者模式,IObservable<T>相当于Subject(主题)接口,下面我们就以代吗来说明下如何利用.net框架提供的观察者模式接口。 WeatherData类包含气温,湿度,气
class Program { private static readonly DiagnosticSource testDiagnosticListener = new DiagnosticListener("TestDiagnosticListener"); public s
.Net Core在调用其他服务时,调用通常使用HttpClient,而HttpClient默认使用HTTP/1.1 。 配置 HttpClient 以使用 HTTP/2 h2 连接 自 .NET Core 3.0 发布以来, .NET 开发人员可以使用 HttpClient 启用 HTTP/2 。
转自:https://www.cnblogs.com/neverc/p/5241466.html AOP介绍 面向切面编程(Aspect Oriented Programming,英文缩写为AOP),通过预编译方式和运行期动态代理实现程序功能的统一维护的一种技术。 AOP是OOP的延续,是软件开发中
<PropertyGroup> <RunWorkingDirectory>../../</RunWorkingDirectory> </PropertyGroup>
https://www.cnblogs.com/ideacore/p/7803606.html 1.安装T4 Toolbox 2.新建T4 Toolbox模板 3.编辑T4 Toolbox模板 Bbing_Template_Mongo_Service.tt 4.添加T4模板 Bbing_T
using System; using System.Collections.Generic; using System.Text; using Dapper; using System.Data; using System.Data.SqlClient; using System.Linq; us
using cpf360.Common; using cpf360.ModelInfo; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Thread
public ActionResult Login(string data) { var _params = JsonConvert.DeserializeAnonymousType(data, new { userName = "", password = "&quo
什么是Elastic AMP Elastic APM 是一个应用程序性能监控系统。它可以请求的响应时间、数据库查询、对缓存的调用、外部 HTTP 请求等的详细性能信息,可以实时监控软件服务和应用程序。这可以帮助我们快速查明和修复性能问题。 Elastic APM 还会自动收集未处理的错误和异常。因此
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; ev
背景 前些天遇到一个需求,在没有第三方源码的情况下,刷新一个第三方UI,并且拦截到其ajax请求的返回结果。当结果为AVALIABLE的时候,停止刷新并语音提示,否则继续刷新。 分析这个需求,发现需要控制一个刷新循环的暂停与开始,因此网上搜到了通过ManualResetEvent实现线程的暂停与恢复
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using cpf360.Common; using cpf360.DTO; name