I’m adding service reference (to Exchange Web Services) to my project, and I’m getting an ambigous reference error at build-time. (Resharper is actually giving me a design time error, VS isn’t)
I’m using AutoMapper (useful library https://github.com/AutoMapper/AutoMapper/wiki) to map my business entities to the DAL, and the compiler assures me that the System.SerializationAttribute exists in both the AutoMapper assembly and mscorlib. It doesn’t exist in the AutoMapper assembly so I’d imagine that’s a bit of a red herring…
I’m a little confused – if I remove the service reference I can use the System.SerializationAttribute decorator with no problems. As soon as I add a service reference to EWS I get this error for any System.SerializationAttribute decorators throughout the project! That gives me a clue that the reference is creating the ambiguity, but where?
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.450")]
[System.SerializableAttribute()] <-- ambiguous ref issue with this decorator
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/exchange/services/2006/types")]
public enum RuleValidationErrorCodeType {
I’ve also got another issue that when I try to add it as a web reference instead, I can’t get to the ‘add web reference’ dialog. I just get a “Cannot create controls for the dialog”. Has anyone seen that before?
It seems there’s a bug with AutoMapper 2.0.0.0, as you can see here, but with Silverlight version
https://github.com/AutoMapper/AutoMapper/issues/181
But if you app doesn’t use Silverlight, you should be able to avoid the problem.
Are you sure you use the “no-silverlight” dll of AutoMapper ?
When you download AutoMapper, you get 2 folders :
Both have an AutoMapper.dll
If you reference the net40-client one, you should be alright.