maplemale
maplemale

Reputation: 2036

How are the xsd.cs files used?

In a biztalk project, why do some XSD files have a hidden xsd.cs and some do not? What are these files used for and why is it, modifying the XSD and rebuilding does nothing to modify the .cs files?

For example: I have an XSD which is used to map messages to a SQL Send/Receive Port and execute a stored procedure. If I change the stored procedure (say change, delete, add a parameter) and thus, change the xsd to match, these changes aren't reflected when I deploy the orchestration unless I delete the xsd.cs. I CAN see the modified xsd in the Schemas tab of the BizTalk Administrative Console. I can see it is modified, yet I will still receive a message routing / mapping error unless that .cs is deleted and the orchestration redeployed. And by the way, after deleting, it never seems to regenerate though it also does not cause any issues.

Upvotes: 1

Views: 1157

Answers (2)

DTRT
DTRT

Reputation: 11040

.cs files are generated for every BizTalk Artifact, that's how them become a .Net Type.

All of this should be handled automatically by Visual Studio. If you are having problems that only deleting .cs files will solve, then there's something wrong with your VS setup.

Note, the .cs files should not be in source control. If they are, remove them.

However, the scenario you describe doesn't make sense. What you see in BT admin is from the .cs file.

Upvotes: 2

Dijkgraaf
Dijkgraaf

Reputation: 11527

Every xsd in your solution should have a .cs file. If you aren't getting them then there is something wrong with your solution. They are the compiled version of the schema that get deployed to the GAC. If the .cs file is not being changed after you recompile then you again have an issue. Check to see if you've accidentally checked the .cs files into source control and that they are now read-only (they should not be checked in).

When you modify the schema you need to both update the version of the schema in the BizTalk database and in the GAC. If you don't you will get some strange results. Using the Deploy option from Visual Studio will do this for you automatically, but if you are manually deploying you will have to ensure that it is both imported and GACed.

Upvotes: 6

Related Questions