Not able to Build project using MSBuild

Hi ,

When i try to build my project using MSBuild in Bamboo, the .dll file is not recognised and hence i get error saying that some variables are not defined.

But when i build my project separately using MSBuild in "Visual Studio 2008 Command Prompt" ,Build is successfull.

Please help .

Thanks in advance :)

4 answers

0 votes
Timothy Chin Community Champion Nov 07, 2013

Screenshot?

05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(1803): warning BC42025: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\BFTPSVC.vb(562): error BC30002: Type 'MailMessage' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\BFTPSVC.vb(566): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\BFTPSVC.vb(571): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\BFTPSVC.vb(571): error BC30451: Name 'AddressType' is not declared.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\BFTPSVC.vb(577): error BC30002: Type 'OpenSmtp.Mail.Smtp' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2071): error BC30002: Type 'MailMessage' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2077): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2078): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2078): error BC30451: Name 'AddressType' is not declared.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2080): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2086): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2086): error BC30451: Name 'AddressType' is not declared.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2091): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2091): error BC30451: Name 'AddressType' is not declared.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2100): error BC30002: Type 'OpenSmtp.Mail.Smtp' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2394): error BC30002: Type 'MailMessage' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2412): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2417): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2417): error BC30451: Name 'AddressType' is not declared.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2422): error BC30002: Type 'EmailAddress' is not defined.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2422): error BC30451: Name 'AddressType' is not declared.
05-Nov-2013 09:47:32 D:\bamboo-home\xml-data\build-dir\BDG-BFTPSVC-JOB1\modMainFunctions.vb(2429): error BC30002: Type 'OpenSmtp.Mail.Smtp' is not defined.
05-Nov-2013 09:47:32 31 Warning(s)
05-Nov-2013 09:47:32 22 Error(s)
05-Nov-2013 09:47:32
05-Nov-2013 09:47:32 Time Elapsed 00:00:04.96
05-Nov-2013 09:47:33 Failing task since return code was 1 while expected 0
05-Nov-2013 09:47:33 Finished task 'BFTPSVC_Build'

Check your .csproj file and make sure that dll's are not excluded or alternately that the desired dll's are included in your build profile. We used to see this a lot with newly added image files and other things that the developers failed to include in their .csproj files. If you have them configured to pull from the local filesystem instead of from the repository file system they will fail on the bamboo build. We had a folder specified for "shared binaries" that contained all the binary files that were created by other projects for inclusion in the build.

In case you didn't see my other post on the subject, do not expect msbuild to work the same as the IDE. The IDE does a lot of things for you that MSBuild does not. The IDE acts more like your mother and "fixes" things so everything is "nice" for you while the MSBuild executable does not. Sometimes you have to be more explicit with MSBuild. All those properties you set in the IDE by hand are not necessarily in the .csproj or .sln files by default.

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,066 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot