How can I tell from the assembly name, or assembly class (or others like it), whether an assembly is part of the .NET framework (that is, System.windows.Forms
)?
So far I've considered the PublicKeyToken, and CodeBase properties, but these are not always the same for the whole framework.
The reason I want this information is to get a list of assemblies that my EXE file is using that need to be on client machines, so I can package the correct files in a setup file without using the Visual Studio setup system. The problem is, I don't want to pick up any .NET framework assemblies, and I want it to be an automatic process that is easy to roll out whenever a major update is finished.
The ultimate solution would be that there is an IsFramework property... :)
No, it doesn't begin with "System". You could check "WindowsBase" which is a framework assembly.
You can't also check the PublicKeyToken, because there are other Microsoft assemblies signed with the "default" keys, but they are not part of the .NET Framework (Visual Studio assemblies).
The best way of doing it is to get a collection of installed .NET frameworks and check if the target assembly is part of their RedistList (
RedistList\FrameworkList.xml
).FrameworkList.xml can be found in: