Yossi Dahan [BizTalk]

Google
 

Sunday, February 03, 2008

GAC stings again....

....or is it just me being stupid again...I don't know...


But anyway - I was working the other day making some changes to one of our classes and, as most of our classes have both code and schema representation, I went on to generate the schema from the modified class.

So - I've built the project with the class to generate an assembly, and in Visual Studio command line I swiftly 'CD'-ed to the bin folder the project and used XSD.exe to generate the schema in order to replace my existing one to reflect the recent changes.

However, to my great surprise, the generated schema did not have any of the added nodes I expected to see - it looked suspicously identical to the old schema I had.

It took me quite a few attempts before I've realised what's happening - as you can imagine from the title of this post the answer lies in the GAC - I had the older version of the assembly containing class in the GAC and so XSD.exe, although being pointed by me a specific assembly in the bin folder, has decided to pick the old one from the GAC and use it to reflect the class.

As soon as I removed the old version from the GAC XSD.exe was happy enough to generate the correct schema for me.

Labels: , ,

1 Comments:

  • Not only you .... this has happened to me a few times before.
    To the point now where in my PostBuildEvent i do a gacutil /f (i think) which forces the GAC to be updated with the latest version.

    By Blogger Ryan, at 04/02/2008, 18:06  

Post a Comment

<< Home