Skip to content

Trouble with referenced third-party libraries #130

@MelGrubb

Description

@MelGrubb

I have a T4 script which I've converted to Scripty so that it can run as part of an AspNetCore solution. The script builds test object factories by reflecting over my Data assembly, where the EF models are defined. The main API project uses AspNet Identity, and so my User object inherits from Microsoft.AspNetCore.Identity.IdentityUser, and this is causing a problem for my script when the reflection tries to build the property type name like this.

var propertyTypeName = property.PropertyType.ToString().Replace("``1[", "<").Replace(']', '>');

The error that I'm getting when the script executes is

// An error occurred while generating property CreatedBy: Could not load file or assembly 'Microsoft.Extensions.Identity.Stores, Version=2.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.

If I break the inheritance from IdentityUser, this code runs just fine, but it seems that the code can't reflect over the ...Identity.Stores assembly because it's not in the bin folder when the script is running. I've added the appropriate NuGet packages to the unit test project hoping that it would copy them in, but it doesn't seem to be doing that.

What do I need to do to make the external assemblies visible to Scripty? I can't be the only one who's run into this problem, can I?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions