FedEx Integration Address Service: Unable to generate a temporary class…ParsedElement[]

Are you using the new WCF service reference against the FedEx Address service WSDL? I’ll bet your scratching your head on why you get this craptastic error.

 InnerException: {"Unable to generate a temporary class (result=1).rnerror CS0030: Cannot convert type 'YOURNAMESPACE.FedExAddressService.ParsedElement[]' to 'YOURNAMESPACE.FedExAddressService.ParsedElement'rnerror CS0029: Cannot implicitly convert type 'YOURNAMESPACE.FedExAddressService.ParsedElement' to 'YOURNAMESPACE.FedExAddressService.ParsedElement[]'rn"}
    Message: "There was an error in serializing body of message addressValidationRequest1: 'Unable to generate a temporary class (result=1).rnerror CS0030: Cannot convert type 'YOURNAMESPACE.FedExAddressService.ParsedElement[]' to 'YOURNAMESPACE.FedExAddressService.ParsedElement'rnerror CS0029: Cannot implicitly convert type 'YOURNAMESPACE.FedExAddressService.ParsedElement' to 'YOURNAMESPACE.FedExAddressService.ParsedElement[]'rn'.  Please see InnerException for more details."
    Source: "mscorlib"

The answer is annoying. You would think running on the .NET 4.0 Framework they would have figured out their bugs with consuming WSDL’s.

So, open your references.cs file for the service. (It’s hidden, you either go to disk or hit the little icon that says show all files, hit the arrow on the service reference, then you see the magic file)

Hit Ctrl+H and type in [][] for the find and replace with [].

Basically, it made this nice two dimensional array that the server is less than pleased to receive.

If you refresh from the WSDL, guess what? You get to do this all over again, so quit hitting the refresh button.

Happy coding!

VS 2010: An error occurred loading a configuration file: Failed to map the path ‘/’.

I was using the System.Web.Configuration.WebConfiguration class to open the configuration for the site from one of my logic dll’s and I got the wonderful error An error occurred loading a configuration file: Failed to map the path ‘/’.

I freaked out for a second, until I put more thought into it. This is running fine in production! What is the difference with my machine and the server?

Oh! My Visual Studio is running under UAC with limited privileges since I am in Windows 7. DUH!

So, I restarted Visual Studio 2010 under “Run as Administrator” and problem solved. So if you are on Vista or Windows 7, that’s the issue.

NOTE: If you develop with administrative rights, be careful you don’t make development mistakes that assume everyone will run your program as an admin. i.e. writing to program files directory, root directory, etc.

Happy Coding!