简体   繁体   English

GAC程序集在运行时引发错误

[英]GAC assemblies throwing error while running

I added an assembly into GAC ,and it is not present in windows/Assembly instead it is present in C:\\Windows\\Microsoft.NET\\assembly\\GAC_MSIL. 我在GAC中添加了一个程序集,它不在Windows / Assembly中,而是在C:\\ Windows \\ Microsoft.NET \\ assembly \\ GAC_MSIL中。 But after I add reference of this assembly it is showing error message like Could not load file or assembly 'Microsoft.ApplicationBlocks.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=76d09afd81300b1a' or one of its dependencies. 但是,在我添加了对该程序集的引用后,它显示了错误消息,例如无法加载文件或程序集'Microsoft.ApplicationBlocks.Data,版本= 3.0.0.0,Culture =中性,PublicKeyToken = 76d09afd81300b1a'或其依赖项之一。 The system cannot find the file specified. 该系统找不到指定的文件。 Any solution for this. 任何解决方案。

.NET before 4.0 uses c:\\windows\\assembly as the GAC folder. 4.0之前的.NET使用c:\\​​ windows \\ assembly作为GAC文件夹。 Starting with 4.0, it uses c:\\windows\\Microsoft.NET\\assembly (because there was a runtime incompatibility change between versions). 从4.0开始,它使用c:\\​​ windows \\ Microsoft.NET \\ assembly(因为版本之间存在运行时不兼容性更改)。 If you use a .NET 4+ tool to install your assembly, it goes to the second GAC, and if you try to reference it from a pre-.NET 4 project, it will look in the first GAC and won't find it. 如果您使用.NET 4+工具安装程序集,则转到第二个GAC,如果尝试从.NET 4之前的项目中引用它,它将在第一个GAC中查找而找不到。 。 See https://stackoverflow.com/a/2660366/552139 参见https://stackoverflow.com/a/2660366/552139

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM