Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

ILMerge and Unit Tests #100

Open
kaluznyt opened this issue Mar 18, 2021 · 0 comments
Open

ILMerge and Unit Tests #100

kaluznyt opened this issue Mar 18, 2021 · 0 comments

Comments

@kaluznyt
Copy link

Hello,

I'm having a problem which I'm not able to solve yet, I have an app that has 2 Projects:
General
Helper

Both are setup with ILMerge, basically the idea is that everything should be merged into General.dll - and that works fine.

Just as a side note - this is use case for Dynamics CRM Plugins.

Now, there is a need to add a Test project.

The test project tests classes in both Helper and General. However, when referencing both, there is an error on build:

error CS0433: The type 'SomeType' exists in both 'General' and 'Helper'

Originally this SomeType class is in Helper.

And the error is understandable, since the General is merged dll so it has the Helper types bundled.
The issue is I'm not able to use those types in Test project by just referencing General, so I need to add Helper as a reference as well.

How to approach this ?

I got an idea that I could create multiple test projects one for each of the tested projects, and that most probably should work, because there is no issue when there is only 1 dependency in test project.

Tried to tweak some settings in the ILMerge.props but without success.

Thanks for any hints !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant