为什么,当我跑:
gacutil –i myAssembly.dll
Run Code Online (Sandbox Code Playgroud)
我得到:
Assembly successfully added to the cache
Run Code Online (Sandbox Code Playgroud)
但是当我跑步时:
gacutil –l myAssembly.dll
Run Code Online (Sandbox Code Playgroud)
我明白了
Number of items = 0
Run Code Online (Sandbox Code Playgroud)
?
我花了几个小时试图弄清楚为什么我的泛型字典(Of String,String)不会忽略大小写.
这是我的代码:
Dim test As New System.Collections.Generic.Dictionary(Of String, String)(System.StringComparison.OrdinalIgnoreCase)
test.Add("FROG", "1")
Console.WriteLine(test.ContainsKey("frog"))
Run Code Online (Sandbox Code Playgroud)
控制台每次都显示"False".它应该显示"真实".
如果我使用:
Console.WriteLine(test."frog"))
Run Code Online (Sandbox Code Playgroud)
我得到一个KeyNotFoundException.
看起来似乎完全忽略了Comparer参数.
到底是怎么回事?
我有一个由Visual Studio生成的Interop DLL,用于在.NET dll中使用的第三方COM对象.
我在GAC中注册了我的消费dll和Interop dll.我必须使用GAC,因为SharePoint 2010工作流正在使用这些DLL.
当执行到达我的dll调用Interop dll的点时,抛出以下错误""无法加载文件或程序集"..."系统找不到指定的文件"与预期的版本和公钥一起.
如果我检查Fusion Assembly Binding Log Viewer,Interop dll的日志条目中列出了以下错误:
LOG: GAC Lookup was unsuccessful.
Run Code Online (Sandbox Code Playgroud)
我可以在GAC中看到该程序集,并且它具有FileNotFound异常中指定的正确版本和公钥标记.
这是怎么回事?