Consider the following scenario. You have a computer that has the Microsoft .NET Framework 2.0 Service Pack 2 (SP2) or the .NET Framework 3.5 SP1 installed. You use an ASMX service method that includes a property, and the property has an internal setter. The serialization may fail. This problem occurs in a scenario that resembles the following:
Note Currently, there is no separate package for the .NET Framework 2.0 SP2. The .NET Framework 2.0 SP2 is included in the package for the .NET Framework 3.5 SP1.
- The public type T includes a public property that has a public getter and an internal setter. For example, the source code may resemble the following.
public class T
{
…
public <Type> <Propertyname1> { get; internal set; }
…
} - In a Web service, the return type or the out argument of at least one Web service method returns objects of type T or objects that contain T in their object graphs. For example, the source code may resemble one of the following examples.
public T MyWebMethod(…)
{
…
}public void MyWebMethod(…, out U)
{
…
}
...
public Class U
{
public T <Propertyname2> { get; set; }
}
- Type T or type U is not used in any Web service methods as a non-out-only argument.
Note If a method has more than one out argument, the out arguments are called non-out-only arguments. - The type of the property that has an internal setter is not Enumerable or Collection.
- Before you applied the .NET Framework 2.0 SP2 or the .NET Framework 3.5 SP1, you generated proxy code to the previously mentioned Web service by using the Wsdl.exe tool or the Visual Studio Add Web reference feature.
- After you deployed the Web service and clients, you applied the .NET Framework 2.0 SP2 or the .NET Framework 3.5 SP1.
Note Currently, there is no separate package for the .NET Framework 2.0 SP2. The .NET Framework 2.0 SP2 is included in the package for the .NET Framework 3.5 SP1.