Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] Getting rid of stale/wrong metadata in web service

Started by Machaira Jul 16, 2009 at 8:50 AM 1 replies 1.2k views
Original Post
Machaira
Machaira
OK, this is seriously ticking me off. I have a web service for allowing the entering of data through a WinForms apps. The web service references a DLL that contains an Item class where one of the members is an enum of bind types: None BindonPickup BindonEquip BindtoAccount The enums are stored in an assembly that's created dynamically as they're read from the database. Originally the enums were being created based on the exact text stored in the table, which had spaces between the names. I've fixed that and cleaned and rebuilt everything but for some reason the service refuses to recognize the new enum. I keep getting the following error when I try to call one of the web methods: System.ArgumentException: Identifier 'Bind on Pickup' is not CLS-compliant. WTF?!? I've even completely recreated the service from scratch 3 times and it just refuses to let go of the old data. Any tips would be helpful.
Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development
Oluseyi
Oluseyi
I had a similar problem once, and I'll describe it and the solution in the hopes that it might help.

I was building an application that included a web service and a separate web application - two different projects in the solution - that needed to share data types that wrapped tables from the DB. The data types were placed in their own assembly (due to bi-directional dependencies between the web application and web service if the data types were in the application assembly) and both projects referenced it. When I went to test the web service, however, I would get errors about type mismatches: the data types from the foreign assembly were being imported into the web service's own namespace, and thus would not match the full type signature of data passed from the web app. This import was not something done explicitly in code, but rather was part of the Visual Studio web service generation process.

The solution was to write a Schema Importer Extension to customize the generated web service proxy, detecting import references to the target data types and overriding the emitted type signature. Because the generator is run by Visual Studio, you actually have to modify the devenv.exe.config file to add your SIE.

Your problem sounded vaguely similar to mine, so I thought I'd share. Hope that helped.
Machaira
Machaira
Hmm, that sounds similar, but not quite the same. I think I managed to fix it though after the 10th time of killing everything that rebuilding. Geez! 8|

Thanks for the reply.
Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.