Samstag, 11. Juni 2016

.NET CLR C2872: 'IServiceProvider': ambiguous symbol

Recommendet blog for Solving 'IServiceProvider' ambiguousity.

https://qualapps.blogspot.de/2008/07/using-atlstrh-in-managed-project.html

That was a good starting point, but does not help me completely.
I started than to reduce one interface to eliminate the error by binary search.
Therefore I decide to eliminate a interface close to the last changes, which probably cause the compiler error.

The Strategy to solve this problem of finding the correct 'using namespace System' is to take a simple interface, which is probably close to the new changes you made, and comment out all members and implement all methods with no content.
The second step is to comment out some includes in this  interface hearder file. One of that include could be the reason of error.
The third step is, to compile the program, to see if the error disapear.

If the error disappear, you found the position of 'usin namespace System' before or inside include of omitted header. The omitted header in the interface you simplify.

If the error does not disappear, you have to reduce /simplify another interface with suspect includes.

Good Luck

 Find a tree, ideally, that's my strategy.

Keine Kommentare:

Kommentar veröffentlichen