I am using .NET 4.5.1 for my WCF service, and .NET 4.0 for a client windows service application.
In the Data Contract, there is a DataMember of type DateTimeOffset?
(a nullable DataTimeOffset
).
When I Add Service Reference to the WCF service, it thinks that DateTimeOffset?
is a complex type. In other words, it doesn't think it's a System.DateTimeOffset?
, it thinks it's a ServiceReference1.DateTimeOffset?
How do I fix this?
Here's what I've tried so far:
Create the most simple example solution that demonstrates this. Unfortunately I couldn't recreate the issue, so it must be something unique to my configuration.
Annotate the
DataContract
class with[KnownType(typeof(DateTimeOffset?))]
. Unfortunately this didn't do anything.Check "Reuse types in referenced assemblies". This had the effect of the "ServiceReference1" object not being available at all in the Console Application.
Anyone have any other ideas on how to fix this?
Thank you.