none
Publish task executes before build Silverlight projects

    Question

  • Hello!

    When I start publish with msbuild from command line it builds Silverlight projects after publish task and .xap files is not actually. Why it's happens? This problem raises when we use tfs build for building and publishing our web applications.

    When we publish web project within Visual Studio building order is correct.

    • Moved by lucy-liu Friday, November 11, 2011 6:10 AM for a better support (From:MSBuild)
    Monday, November 07, 2011 7:15 AM

All replies

  • Hi IlshatM,

    The previous versions of MSBuild, will build the projects in the solution in the correct order, but the 4.0 version of MSBuild.exe gets the order wrong.

    Essentially the problem is that MSBuild doesn't know anything about the project files until it starts to build them.

    We can follow this principle to fix this issue: do not use dependencies expressed in the solution file at all! Better to express dependencies in the file that has the dependency: put a project reference in the project, instead.

    More informationhttp://blogs.msdn.com/b/visualstudio/archive/2010/12/21/incorrect-solution-build-ordering-when-using-msbuild-exe.aspx

    If I have misunderstood anything, please feel free to let us know.

    Thank you for  your understanding!

     

    Best regards,

    Lucy


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, November 08, 2011 6:21 AM
  • But I asked about publish task not building.I thought these task's types are differ and wait that first solution builds and then publish starts...

    Tuesday, November 08, 2011 4:29 PM
  • Hi IlshatM,

    Do you do any actions to your publish task?

    Please try to clean this project , then build again, see whether this issue still exists.

    If this issue still exists, please refer to the following code to get the log file and paste it to this thread:

    msbuild my.csproj /distributedFileLogger /fileLoggerParameters:LogFile= e:\MyLog.log

    More information: http://msdn.microsoft.com/en-us/library/ms164311.aspx

    If this issue remains, please try to create a new project to see whether this issue still exists, Sometimes corrupted project settings can cause problems. These are project specific.

     

    Best regards,

    Lucy


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, November 09, 2011 7:32 AM
  • Hi IlshatM,

    According to your description, you use TFS to build this project, do you use TFS2008 or TFS2010? And please give the arguments and settings detail.

    In addition, please try to use MSBuild and not use TFS Build , see whether this issue still exists.

     

    Best regards,

    Lucy


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, November 10, 2011 7:14 AM
  • We use TFS2010. I tried to build with msbuild too. It has the same behavior. (in my first message I wrote about msbuild exactly).

    Thursday, November 10, 2011 7:38 AM
  • Hi IlshatM,

    I am moving this thread from “MSBuild" forum to the “Team Foundation Server - Build Automation” forum for a better support.

    Thank you for your understanding and support.

     

    Best regards,

    Lucy


    Lucy Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, November 11, 2011 6:10 AM