Can I find an assembly by the file path?

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 5 years ago by Frank Wisniewski
Version: 14.2.0610
Avatar

How can I access the path on disk where an assembly is loaded from when I am looping through a CSharpProjectAssembly.AssemblyReferences collection instance?  The IProjectAssemblyReference does not appear to have any location property but when I debug and inspect the running variable I am able to drill down to a property called location that has the file path.  What interface do I need to cast the IProjectAssemblyReference instance to inorder to get access to the location property?

Comments (2)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Frank,

The IProjectAssembly has an Assembly property.  If the assembly was a binary assembly (.dll file) that was loaded from a path, it should be of type BinaryAssembly.  That type has a Location property on it that should be what you want.


Actipro Software Support

Posted 5 years ago by Frank Wisniewski
Avatar

Thanks, that is exactly what I was looking for.

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.