If the packages folder contains a package which has a framework assembly reference, e.g. ScriptCs.Contracts, which references System.ComponentModel.Composition, then scriptcs.exe crashes and dies.
This is because, as part of the fix for #913, it's now passing all the assemblies through AssemblyUtility.IsManagedAssembly(), which in turn calls AssemblyName.GetAssemblyName(path), but "System.ComponentModel.Composition" is not a path, so a FileNotFoundException is thrown, and unhandled.
AssemblyUtility.IsManagedAssembly() is already catching BadImageException and returning false in that case, so I guess it should also catch FileNotFoundException and also return false in that case.
Note, that the script pack acceptance test is passing, even with this bug present, because ScriptCs.Adder doesn't take a dependency on ScriptCs.Contracts but ships the DLL in the package instead.
I thought perhaps we'd like to try a 'patch master' approach for this (so dev is free to progress independently in the meantime):
If the packages folder contains a package which has a framework assembly reference, e.g. ScriptCs.Contracts, which references
System.ComponentModel.Composition, then scriptcs.exe crashes and dies.This is because, as part of the fix for #913, it's now passing all the assemblies through
AssemblyUtility.IsManagedAssembly(), which in turn callsAssemblyName.GetAssemblyName(path), but"System.ComponentModel.Composition"is not a path, so aFileNotFoundExceptionis thrown, and unhandled.AssemblyUtility.IsManagedAssembly()is already catchingBadImageExceptionand returning false in that case, so I guess it should also catchFileNotFoundExceptionand also return false in that case.Note, that the script pack acceptance test is passing, even with this bug present, because ScriptCs.Adder doesn't take a dependency on ScriptCs.Contracts but ships the DLL in the package instead.
I thought perhaps we'd like to try a 'patch master' approach for this (so dev is free to progress independently in the meantime):