Skip to content

scriptcs 0.13.1 crashes when a package has a framework assembly reference #922

@adamralph

Description

@adamralph

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):

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions