简体   繁体   English

尽管引用了程序集却无法加载

[英]Could not load an assembly despite it being referenced

I'm looking at incorporating the new Google Apps Script Execution API into an existing C# plugin i have already working. 我正在考虑将新的Google Apps脚本执行API集成到我已经可以使用的现有C#插件中。 I am following the .NET quickstart guide provided as a console application (which i have gotten working without problem). 我正在遵循作为控制台应用程序提供的.NET快速入门指南 (我已经可以正常使用了)。

When porting the code from that into my plugin it will also fail at runtime at the first instance of: 将代码从其中移植到我的插件时,它在以下情况的第一个实例上也会在运行时失败:

UserCredential credential;

which I slimmed down the code so far to just that line which fails giving: 到目前为止,我已将代码精简到无法给出的那一行:

"Could not load file or assembly 'Google.Apis.Auth, Version=1.9.2.27817, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' or one of its dependencies. The system cannot find the file specified." “无法加载文件或程序集'Google.Apis.Auth,版本= 1.9.2.27817,文化=中性,PublicKeyToken = 4b01fa6e34db77ab'或其依赖项之一。系统找不到指定的文件。”

The file is properly referenced (having installed via nuget). 正确引用了该文件(已通过nuget安装)。

C# is not my normal field and perhaps i'm missing something in the subtlety of it working in a Console App. C#不是我的常客领域,也许我在控制台应用程序中缺少它的精妙之处。

What gives? 是什么赋予了?

There was a time when console apps defaulted to using the client profile rather than the full .Net framework. 曾经有一段时间,控制台应用程序默认使用客户端配置文件而不是完整的.Net框架。 Check the properties of the project on the Application tab and make sure the target framework doesn't end with Client profile. 在“应用程序”选项卡上检查项目的属性,并确保目标框架不以“客户端”配置文件结尾。 If that doesn't work try using the fusion log viewer , which you'll find conviently located at C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin, or any number of other places . 如果这样不起作用,请尝试使用融合日志查看器 ,您会发现它位于C:\\ Program Files(x86)\\ Microsoft SDKs \\ Windows \\ v7.0A \\ Bin 或任何其他位置 Run it as an admin and it'll tell you what it can't load (which may or may not be Google.Apis.Auth) and where it looked for the file at. 以管理员身份运行它,它将告诉您无法加载的内容(可能是Google.Apis.Auth,也可能不是),以及在何处查找文件。

This has been a little bit of a red herring. 这有点像鲱鱼。 Not very well documented is the fact for the app i am building against, Autodesk Navisworks, plugin dependency libraries have to be duplicated in a separate directory altogether from the plugins directory. 我所针对的应用程序(Autodesk Navisworks)的事实并没有得到很好的记录,插件依赖库必须从plugins目录复制到一个单独的目录中。

Easily fixed for the build environment, but will need a little more thought for when creating a distributable. 易于针对构建环境进行修复,但是在创建可分发文件时需要多加考虑。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尽管已正确引用,但未找到强类型的程序集 - Strongly-typed assembly not being found despite being correctly referenced 应用程序项目得到“无法加载文件或程序集”,而被引用的项目测试正常 - Application Project gets "Could not load file or assembly" while the project being referenced tests fine 尽管引用了.dll,但找不到C#名称空间错误 - C# namespace could not be found error, despite the .dll being referenced 尽管安装了先决条件,但无法加载程序集Microsoft.ReportViewer.Common - Could not load assembly Microsoft.ReportViewer.Common, despite installing the prerequisites 无法加载程序集...确保它被启动项目引用 - Could not load assembly... Ensure it is referenced by the startup project “无法加载引用的程序集System.Core.dll” - “Could not load referenced assembly System.Core.dll” 引用的项目“ Copy Local = false”显示“无法加载文件或程序集” - “Copy Local = false” referenced project shows “Could not load file or assembly” 当引用的 dll 文件位于加载的程序集中时,“无法加载文件或程序集” - "Could not load file or assembly" when the referenced dll file is in the loaded assemblies 无法加载程序集“CommonBaseData”。 确保它被启动项目“CommonBaseType”引用 - Could not load assembly 'CommonBaseData'. Ensure it is referenced by the startup project 'CommonBaseType' 由于引用了针对.Net Framework 3.5的程序集,因此无法加载文件或程序集版本为2.0.5.0的系统 - Could not load file or assembly System, Version=2.0.5.0 due to the referenced assembly targeting .Net Framework 3.5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM