![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Assembly.LoadFile and Code Analysis warning CA2001 Hey all, I've implemented a simple plug-in based file parser for a customer and I'm running into CA2001, which I'd like to solve. The problem is that I cannot find any information on how to solve this error, other than removing my call to Assembly.LoadFile. There are some alternatives, but they are either also in the blacklist for CA2001, or they're deprecated. What I'm trying to accomplish is to load my file format description (classes decorated with custom attributes) from a specific directory (e.g. /bin/formats). I'm using the following code: foreach (string dll in Directory.GetFiles(Path.Combine(Directory.GetCurrentDirectory(), "Formats"), "*.dll")) { Assembly ass = Assembly.LoadFile(dll); Type[] types = ass.GetTypes(); } Any other approaches I could use for this? Can I tell the framework to load all my assemblies by adding a config directive? Or is there a Load* method in Assembly that I might have missed? -- Jesse Houwing jesse.houwing at sogeti.nl |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Code analysis tool? | .NET General | |||
| Error Code Analysis | Vista General | |||
| VS 2008 & Code Analysis | .NET General | |||
| Assembly.LoadFile and nested PS instance | PowerShell | |||
| [Reflection.Assembly]::LoadFile locks file | PowerShell | |||