草庐IT

ASSEMBLY

全部标签

c# - Assembly.GetType 返回 null

我正在尝试动态加载加密程序集,但我的GetType返回null,即使我使用的是正确的类名。这是代码://Loadencryptionassembly.AssemblyencryptionAssembly=Assembly.LoadFrom("Encryption.dll");foreach(TypetinencryptionAssembly.GetTypes()){MessageBox.Show(t.Name.ToString());//Thisshows"Encryption"}TypeencryptionClass=encryptionAssembly.GetType("Encry

c# - Razor View 中 foreach 循环中的 Assembly Not Referenced 编译错误

编辑:我已经检查并尝试了在SE上发现的许多其他程序集未引用问题,但我没有发现很多处理应该是内置程序集的问题(System.Collections.Generic.List)。这使得手动添加或删除引用等变得困难。我正在尝试从API响应构建PartialView。我已确认响应正确且格式正确,我的对象正在正确构建,但是当我生成局部View时,显示的是编译错误。CompilerErrorMessage:CS0012:Thetype'System.Collections.Generic.List`1'isdefinedinanassemblythatisnotreferenced.Youmust

c# - 无法加载文件或程序集临时 ASP.NET 文件

我正在使用C#(.NETFramework4)在ASP.NET上开发一个网站。创建新网站项目后,我尝试运行该项目。但我收到以下错误:Couldnotloadfileorassembly'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\TemporaryASP.NETFiles\myfirst\159977c5\b9e740fc\App_global.asax.yfqtni9g.dll'oroneofitsdependencies.Thesystemcannotfindthefilespecified.我已经浏览了下面的链接[并

c# - 错误 : Native images generated against multiple versions of assembly System.Net.Http.Primitives

我在我的WP8.1应用程序中遇到了这个错误,Application_UnhandledExceptionERROR:NativeimagesgeneratedagainstmultipleversionsofassemblySystem.Net.Http.Primitives.atCoolEditor.Class.DropNetRt.DropNetClient.LoadClient()atCoolEditor.Class.DropNetRt.DropNetClient..ctor(StringapiKey,StringappSecret)atCoolEditor.MainPage.d_

c# - .NET 自定义配置部分 : Configuration. GetSection 引发 'unable to locate assembly' 异常

我已经为一个插件DLL创建了一个自定义配置部分,它将.configXML存储在一个单独的(与主可执行应用程序不同的)文件中。这是自定义部分类的示例:usingSystem;usingSystem.Configuration;namespacePluginFramework.MyConfiguration{publicclassMyConfigurationSettings:ConfigurationSection{privateConfiguration_Config=null;#regionConfigurationProperties//////AcustomXMLsectionf

c# - ASP.NET 损坏的程序集 "Could not load file or assembly App_Web_*"

我已经阅读了同一问题上发布的许多其他问题,但我仍然不明白原因以及如何防止它发生。在我的例子中,这发生在生产服务器上。我遇到了其他问题中描述的相同错误,我通过将程序集重新复制到bin目录中来解决它。它们甚至不是重新编译的文件,它们与之前的文件相同-再次复制,然后它开始正常工作。奇怪的是,我正在使用Web部署项目将我所有的程序集文件重命名为基于文件夹的dll。所以folder.dll和folder.subfolder.dll而不是App_Web_jt8nxllz.dll。然而,错误仍然命名为原始App_Web_jt8nxllz.dll文件。删除C:\WINDOWS\Microsoft.NE

c# - 如何找到依赖于特定依赖项的特定版本?

我在运行我的应用程序时遇到此错误(不是在编译时):Couldnotloadfileorassembly'Castle.Windsor,Version=2.1.0.0,Culture=neutral,PublicKeyToken=407dd0808d44fbdc'oroneofitsdependencies.Thelocatedassembly'smanifestdefinitiondoesnotmatchtheassemblyreference.(ExceptionfromHRESULT:0x80131040)我的解决方案有很多项目,尽可能使用项目引用,但其中一些项目具有对外部依赖项的

c# - 什么应该放入 AssemblyTrademarkAttribute 中?

VisualStudio默认为C#程序集生成这组属性:[assembly:AssemblyTitle("ContosoApp")][assembly:AssemblyDescription("Contoso'slatestgreatproduct.")]#ifDEBUG[assembly:AssemblyConfiguration("Debug")]#else[assembly:AssemblyConfiguration("Release")]#endif[assembly:AssemblyCompany("ContosoCorporation")][assembly:Assembly

c# - 比较和交换有什么用?

我最近在读关于CompareAndSwap的文章原子操作(CMPXCHG、.NET的Interlocked.CompareExchange等)。我了解它在内部是如何工作的,以及它是如何从客户那里使用的。我不太明白的是什么时候有人会使用CAS?维基百科说:CASisusedforimplementingsynchronizationprimitiveslikesemaphoresandmutexes,likewisemoresophisticatedlock-freeandwait-freealgorithms.那么,谁能给我一个更通用的真实世界用例,其中包含代码和CAS使用说明?这个问

c# - System.IO.FileLoadException : Could not load file or assembly 'System. 数据.SQLite

(这是一个在stackoverflow.com中被问到的重复问题。我已经阅读了答案。我已经尝试了这些解决方案,但这并没有解决我的问题。我将解释我的问题是什么我做了什么)。这是我的问题:我的应用程序使用了System.Data.SQLite.DLL。我引用了它,在我的电脑上运行正常,但在另一台电脑上运行失败。这是错误消息:System.IO.FileLoadException:Couldnotloadfileorassembly'System.Data.SQLite,Version=1.0.88.0,Culture=neutral,PublicKeyToken=db937bc2d44ff