I have encountered a strange issue. When I update one of my websites to a web service by
- Updating it or
- Removal of the service and readding it altogether
The intellisense still reports that the type, in this case Document_Type3
is still the same type of an object generated by the service. I can set my object type to `Document_Type3'. I build the project, no issues.
However, when I run the project, I get a compiler error saying that that my object which is Document_Type3 doesn't contain the Order
.
Compiler Error Message: CS0117: 'DynamicsNAV.Document_Type3' does not contain a definition for 'Order'
Source Error:
Line 376: comment.Date = DateTime.Now;
Line 377: comment.DateSpecified = true;
Line 378: comment.Document_Type = Document_Type3.Order; <-- right here.
Line 379: comment.Document_TypeSpecified = true;
Line 380: comment.Line_No = i * 1000;
The hell it doesn't. I can see it right there.
<xsd:simpleType name="Document_Type"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Quote" /> <xsd:enumeration value="Order" /> </xsd:restriction> </xsd:simpleType>
I can set it fine, compile it fine -- but I can't run it.
I nuked my temporary files in
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
thinking that it perhaps has cached these dynamically generated objects. I rebuilt the project and watched the website reappear, along with the objects, in the temporary directory.
When I run it -- same thing -- no compiler error until it actually loads in the browser. An important issue to note is that these services are being returned by Dynamics NAV, and types that have the same name, such as Document_Type, will be appended with a number on the end. In the code, again, Document_Type3 contains Order
and Quote
.
What the heck is going on?