IdentityServer / IdentityServer3.EntityFramework

EntityFramework persistence layer for IdentityServer3
Apache License 2.0
68 stars 97 forks source link

AutoMapper - DLL Not put in Bin TFS and MSBuild #98

Closed BruceHunter closed 8 years ago

BruceHunter commented 8 years ago

I have a Web Application Project that separates my "Host" into a Sub DLL for re-use purposes.

Web Application Project -> Host (Configure, IdenityServer3, Controllers etc).

The Host Project is using IdentityServer3.EntityFramework, which relies on AutoMapper. I recently upgraded to IdentityServer3.EntityFramework.2.4.2 and of course AutoMapper 4.2.1.

My Web Application Project does not include the nuget packages from the above 2.

When I compile with Visual Studio, the AutoMapper.dll gets put into the bin directory. However, when we check-in to TFS and use msbuild to target the WebApplication, then AutoMapper does not get included in the bin directory.

I have 2 choices.

1) Add a reference in my WebApplication to AutoMapper. 2) In my Host Project, add a line of code like this. AutoMapper.IMapper _doNotRemoveHack; // MSBuild is not pulling Automapper.dll

I do not want to add a reference, cause that makes no sense when that Project doesn't need it. I also hate the hack as well, but I took option 2 and that resolved my issue.

This is an issue / difference with VS and MSBuild; however I wanted to let you know about this.

I didn't have this issue until I upgraded.

brockallen commented 8 years ago

Thanks for the note. I'm really not sure how others handle this, but this will be here in the archives for anyone else. Thx.