this Error is quite cryptic because it doesnt say which field failed.
After a long struggle I figured out that it was because of mapping a string element to a decimal element in xml.
it was trying to insert empty string "" into a decimal field.
The way i resolved this was to put a logical numeric functoid , followed by a value mapping functoid which resolved this.
hi I encountered this error today while building an Orchestration
Error 9 'System.String' must be Xml serializable to be a message part type -- check event log for more information C:\asa\sds\oresCanonical.odx
the Only solution I have is to restart visual studio every time i get this error
any Ideas to resolve this.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="AddBtResx;">
<PropertyGroup >
<BTServerName></BTServerName>
<BTServerDatabase></BTServerDatabase>
<MsgFailed>Failed Adding Resource for </MsgFailed>
<MsgSuccess>success Adding Resource for </MsgSuccess>
<ResxAppName>Finance</ResxAppName>
<Locn>"c:\Program Files\Microsoft\Bin\Microsoft.Talk.Adapter.Schemas.dll"</Locn>
</PropertyGroup>
<Target Name="AddBtResx" >
<Exec Command='btstask AddApp -A:$(ResxAppName) -Server:$(BTServerName) -Database:$(BTServerDatabase)'/>
<Exec Command='btstask AddResource -A:$(ResxAppName) -T:"System.BizTalk:BizTalkAssembly" -OverWrite -Server:$(BTServerName) -Database:$(BTServerDatabase) -Source:$(Locn)'/>
<Message Importance ="high" Text ="$(MsgSuccess) : $(ResxAppName)" ContinueOnError ="true" ></Message>
<OnError ExecuteTargets ="HandleErr"/>
</Target>
<Target Name="HandleErr" >
<Message Importance ="high" Text ="$(MsgFailed) : $(ResxAppName)" ContinueOnError ="true" ></Message>
</Target>
</Project>
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="EmailIt">
<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />
<
PropertyGroup >
<
MsgFailed>Failed Email for </MsgFailed>
<
MsgSuccess>success Email for </MsgSuccess>
</
PropertyGroup>
<Target Name="EmailIt" >
<Email MailTo="abc@ms.com"
MailFrom="sundar@ms.com"
SmtpServer="EmailSMTPServer.ms.com or Ip address of the server"
Subject=" Build status Today"
Body="Hi All,<BR/>
Today’s Daily Build and Deployment Completed:
<BR/><BR/>
Format="HTML"
Attachments="$(ResultsItem)$(BuildLogZip)"
/>
<OnError ExecuteTargets ="HandleErr"/>
</Target>
<Target Name="HandleErr" >
<Message Importance ="high" Text ="$(MsgFailed) : " ContinueOnError ="true" ></Message>
</
Target>
</
Project>
this Explains how to use Msbuild to zip some log files. the zipfilename is generated from date time information, hence unique.
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="ZipLogs">
<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />
<
PropertyGroup >
<
MsgFailed>Failed Email for </MsgFailed>
<
BuildLogZip>buildlogs.zip </BuildLogZip>
</
PropertyGroup>
<Target Name="ZipLogs" >
<Time.GetTime Format="yyyyMMMdd-hh-mm" >
<Output TaskParameter="Time" PropertyName="ResultsItem" />
</Time.GetTime>
<Message Text="$(ResultsItem)" ></Message>
<Zip.AddFile
pathToZipFile="$(ResultsItem)$(BuildLogZip)"
pathToFile="Summary1.log" />
<Zip.AddFile
pathToZipFile="$(ResultsItem)$(BuildLogZip)"
pathToFile="Build.Log" />
</Target>
</
Project>
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="RunUnitTests">
<
Target Name="RunUnitTests" >
<
Exec Command='MSTest.exe /testmetadata:"c:\testproj.vsmdi"' />
<
Message Importance ="high" Text ="MsgSuccess : " ContinueOnError ="true" ></Message>
</
Target>
</
Project>
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="StartHosts">
<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />
<
PropertyGroup >
<
MsgFailed>Failed StartHosts for </MsgFailed>
<
MsgSuccess>success StartHosts for </MsgSuccess>
<
BTServerName></BTServerName>
<
BTServerDatabase></BTServerDatabase>
<HostInst>Your Host Instance Name</HostInst>
</PropertyGroup>
<Target Name ="StartHosts" >
<WriteLinesToFile File="$(HighLevelErrFile)" Lines="Starting BizTalk Host ..." Overwrite="false"/>
<Message Text ="Starting BizTalk Host $(HostInst)"></Message>
<BizTalk2004.Host.Start DisplayName="$(HostInst)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />
<
OnError ExecuteTargets ="HandleErr"/>
</
Target>
<
Target Name="HandleErr" >
<
Warning Text ="$(MsgFailed) : $(HostInst)" ContinueOnError ="true" HelpKeyword ="HostsErr" ></Warning>
</Target>
</
Project>
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="StartBizTalkApplication">
<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />
<
PropertyGroup >
<
MsgFailed>Failed StartApp for </MsgFailed>
<
MsgSuccess>success StartApp for </MsgSuccess>
<
BTServerName></BTServerName>
<
BTServerDatabase></BTServerDatabase>
<AppName>xyz</AppName>
</
PropertyGroup>
<
Target Name="StartBizTalkApplication" >
<
BizTalk2006.Application.Start Application="$(AppName)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />
<OnError ExecuteTargets ="HandleErr"/>
</
Target>
<
Target Name="HandleErr" >
<
Message Importance ="high" Text ="$(MsgFailed) : $(AppName)" ContinueOnError ="true" ></Message>
</Target>
</
Project>
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="PublishSite">
<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />
<
PropertyGroup >
<
MsgFailed>Failed PublishWebSite for </MsgFailed>
<
MsgSuccess>success PublishWebSite for </MsgSuccess>
<
AppPoolName>DefaultAppPool</AppPoolName>
<
WebSiteName>Default Web Site</WebSiteName>
<
WebSiteHost>mymachinename</WebSiteHost>
<
WebService Include="MyWebService">
<
WebSitePath>C:\Inetpub\wwwroot\SampService</WebSitePath>
<
TFSPath> C:\Development\Store\SampWebService\</TFSPath>
</
WebService>
</PropertyGroup>
<
Target Name="PublishSite" >
<
Web.WebSite.DeleteVirtualDirectory
VirtualDirectoryName="$(WebService)"
MachineName="$(WebSiteHost)"
WebSiteName="$(WebSiteName)"/>
<
AspNetCompiler Clean ="true"
PhysicalPath ="$(TFSPath)"
TargetPath ="$(WebSitePath)" VirtualPath ="/$(WebService)"
Updateable ="false" Force="true" ></AspNetCompiler>
<
Web.WebSite.CreateVirtualDirectory
VirtualDirectoryName="$(WebService)"
Path="$(WebSitePath)"
MachineName="$(WebSiteHost)"
AppPoolID="$(AppPoolName)"
WebSiteName="$(WebSiteName)"
/>
<
OnError ExecuteTargets ="HandleErr"/>
</
Target>
<
Target Name="HandleErr" >
<
Message Importance ="high" Text ="$(MsgFailed) : $(WebService)" ContinueOnError ="true" ></Message>
</
Target>
</
Project>
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="AddReferences;ImportBindings">
<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />
<
PropertyGroup >
<
MsgFailed>Failed Binding for </MsgFailed>
<
MsgSuccess>success Binding for </MsgSuccess>
<
BTServerName></BTServerName>
<
BTServerDatabase></BTServerDatabase>
<AppName>Customer</AppName>
<BindingDir>x.xml</BindingDir>
</PropertyGroup>
<Target Name="AddReferences" >
<BizTalk2006.Application.AddReferences Application="$(AppName)" ReferenceApplications="$(RefApplication)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />
</Target>
<Target Name="ImportBindings" >
<Exec Command='Btstask.exe ImportBindings -Source:"$(BindingDir)" -A:$(AppName) -Server:$(BTServerName) -Database:$(BTServerDatabase)' />
<Message Importance ="high" Text ="$(MsgSuccess) : $(AppName)" ContinueOnError ="true" ></Message>
<WriteLinesToFile File="$(HighLevelErrFile)" Lines="$(MsgSuccess) $(AppName) $(BindingDir)" Overwrite="false"/>
<OnError ExecuteTargets ="HandleErr"/>
</Target>
<Target Name="HandleErr" >
<Message Importance ="high" Text ="$(MsgFailed) : $(AppName)" ContinueOnError ="true" ></Message>
</
Target>
</
Project>
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="CheckAppExists;StopApplication;RemoveReferences;UnDeploy">
<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />
<
PropertyGroup>
<
AppExists>False</AppExists>
<
BTSRefApp></BTSRefApp>
<
BTServerName></BTServerName>
<
BTServerDatabase></BTServerDatabase>
<BTAppName>customercare</BTAppName>
</PropertyGroup>
<Target Name="CheckAppExists" >
<
BizTalk2006.Application.Exists Application="$(BTAppName)" Server="$(BTServerName)" Database="$(BTServerDatabase)">
<
Output TaskParameter="DoesExist" PropertyName="AppExists" />
</
BizTalk2006.Application.Exists>
</
Target>
<
Target Name="StopApplication" DependsOnTargets="CheckAppExists" Condition="$(AppExists)=='True'">
<
BizTalk2006.Application.Stop Application="$(BTAppName)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />
</
Target>
<
Target Name="RemoveReferences" Condition="$(AppExists)=='True'" >
<
BizTalk2006.Application.RemoveReferences Application="$(BTAppName)" ReferenceApplications="$(BTSRefApp)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />
</
Target>
<
Target Name="UnDeploy" Condition="$(AppExists)=='True'" >
<
BizTalk2006.Application.Delete Application="$(BTAppName)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />
</
Target>
</
Project>
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="StopHosts">
<
Import Project="C:\sdc\Microsoft.Sdc.Common.Tasks" /> -- Download sdctasks from Codeplex.com and put it here
<
PropertyGroup >
<
MsgFailed>Failed Stop Hosts for </MsgFailed>
<
MsgSuccess>success Stop Hosts for </MsgSuccess>
<
BTServerName></BTServerName>
<
BTServerDatabase></BTServerDatabase>
< HostInst>Customercare</HostInst>
</
PropertyGroup>
<
Target Name="StopHosts" >
<Message Text ="Stopping BizTalk Host $(HostInst)"></Message>
<
BizTalk2004.Host.Stop DisplayName="$(HostInst)" Server="$(BTServerName)" Database="$(BTServerDatabase)" />
<OnError ExecuteTargets ="HandleErr"/>
</
Target>
<
Target Name="HandleErr" >
<
Warning Text ="$(MsgFailed) : $(HostInst)" ContinueOnError ="true" HelpKeyword ="HostsErr" ></Warning>
</
Target>
</
Project>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="BuildSolutions;SuccessLog">
<PropertyGroup >
<MsgBuildFailed>Failed deploy for </MsgBuildFailed>
<MsgBuildSuccess>success deploy for </MsgBuildSuccess>
</PropertyGroup>
<Target Name="BuildSolutions">
<WriteLinesToFile File="$(HighLevelErrFile)" Lines="Compiling Biztalk Projects..." Overwrite="false"/>
<Message Importance ="normal" Text ="start deploy"></Message>
<Exec Command='devenv.com /deploy Release "c:\abc.sln"'
Outputs='c:\abc.sln' >
<
Output TaskParameter="Outputs" PropertyName="BuildDone" />
</
Exec >
<
OnError ExecuteTargets ="HandleErr" />
</
Target>
<
Target Name="SuccessLog">
<
Message Importance ="high" Text ="$(MsgBuildSuccess) : $(BuildDone)" ContinueOnError ="true"></Message>
<
WriteLinesToFile File ="$(HighLevelErrFile)" Lines="$(MsgBuildSuccess) : $(BuildDone)" ContinueOnError="true"></WriteLinesToFile>
</
Target>
<
Target Name="HandleErr">
<
Message Importance ="high" Text ="$(MsgBuildFailed) : $(BuildDone)" ContinueOnError ="true"></Message>
<
WriteLinesToFile File ="$(HighLevelErrFile)" Lines="$(MsgBuildFailed) : $(BuildDone)" ContinueOnError="true"></WriteLinesToFile>
</
Target>
</
Project>
I have used exec task inside msbuild and achieved the same.. for the rest like stopping / starting host instances, I use sdc tasks..
<Target Name="BuildSolutions">
<Exec Command='devenv.com /build $(BuildType) "c:\customer.btproj"' >
</Target>
full detail here;
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="BuildSolutions;SuccessLog">
<PropertyGroup >
<
MsgBuildFailed>Failed Build for </MsgBuildFailed>
<
MsgBuildSuccess>success Build for </MsgBuildSuccess>
</
PropertyGroup>
<
Target Name="BuildSolutions">
<
WriteLinesToFile File="$(HighLevelErrFile)" Lines="Compiling Biztalk Projects..." Overwrite="false"/>
<
Message Importance ="normal" Text ="start build "></Message>
<
Exec Command='devenv.com /build Release "c:\abc.sln"'
Outputs='c:\abc.sln' >
<
Output TaskParameter="Outputs" PropertyName="BuildDone" />
</
Exec >
<
OnError ExecuteTargets ="HandleErr" />
</
Target>
<
Target Name="SuccessLog">
<
Message Importance ="high" Text ="$(MsgBuildSuccess) : $(BuildDone)" ContinueOnError ="true"></Message>
<
WriteLinesToFile File ="$(HighLevelErrFile)" Lines="$(MsgBuildSuccess) : $(BuildDone)" ContinueOnError="true"></WriteLinesToFile>
</
Target>
<
Target Name="HandleErr">
<
Message Importance ="high" Text ="$(MsgBuildFailed) : $(BuildDone)" ContinueOnError ="true"></Message>
<
WriteLinesToFile File ="$(HighLevelErrFile)" Lines="$(MsgBuildFailed) : $(BuildDone)" ContinueOnError="true"></WriteLinesToFile>
</
Target>
</
Project>
<
Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="GetLatestFromTFS" >
<
Message Importance ="normal" Text ="start GetLatest for "></Message>
<
Exec Command='TF.exe get "$/ProjRoot" /overwrite /recursive /login:$(LoginCreds)'
ContinueOnError="False"/>
</
Target>
</
Project>