Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Build mvc project



  • Hi,

    using MSBuild on an MVC (web application) project does not publish correctly

    I have used BM 4.8 and there was a build MVC project. Does this option exist in BM 5.3?

    I have tried to added a target to the project file and run msbuild to publish the project. This does what I expect, however when I create artifact, the artifact has an extra subdirectory in the zip file.

    should be:
    zip -> list of files and directories

    the artifact contains:

    zip -> eb -> list of files and directories

    The extra subfolder screw up the deploying of the artifact.

    Product: BuildMaster
    Version: 5.5.3



  • Unfortunately, the "build MVC project" was unreliable (it uses an unsupported method for extracting website contents), and most Microsoft build automation has moved towards simply running the MSBuild directly. So, we took same approach in v5, and decided not to port the action.

    That said, you can easily work around this by changing how you capture the artifact. Instead of saying, "from $WorkingDirectory", just do, "from $WorkingDirectory\eb".



  • OK, the publishing the MVC project to a deployed folder, correctly creates everything in the right place.

    The creating of the artifact adds a eb subfolder and then zips the deployed folder under that subfolder, instead just the deployed folder files and directories. What is creating the eb subfolder?

    \DeployedFolder<all files and sub folder of website>

    Aritifact (zip file)
    \eb<all files and sub folder of website>

    I believed it should just be
    <all files and sub folder of website>

    with no subfolder



  • You would have to dig into the MSBuild script (i.e. your csproj file) to find that out.

    The actual/desired output folder will vary depending on the version of Visual Studio it was created with, the project template used, what project settings there are, etc. Sometimes it's \bin\_PublishedWebsites\{CsProjName}, sometimes it's \_WebOutputs\{CsProjName}, sometimes it's \bin\{Config}\{csProjName}\_Content... and apparently in your case it's \eb (which is a new one to me).

    So, you can see why it was difficult for us to play the guessing game :)



  • What I am seeing is that Create Artifact is adding the subfolder and not MSBuild.

    Also, should I be able to use the the $WorkingDirectory variable anywhere?

    Below is my MSBuild script

    MSBuild::Build-Project $WorkingDirectory\Source\Fpp.UI.Web\Fpp.UI.Web.csproj
    (
    Configuration: Release,
    Platform: AnyCPU,
    Arguments: /p:PublishDestination=$WorkingDirectory\Deployments\Fpp.UI.Web /t:PublishToFileSystem
    );

    this ignores the 2nd reference to $WorkingDirectory, does not get replaced and creates the build output in the c:\Deployments\Fpp.UI.Web instead of the working directory



  • You can Log-Information to see what $WorkingDirectory is. Unless you set a value, it will be something like C:\BuildMaster\_SVCTMP\_Ennn\D0 where nnn is internal identifier of the execution.

    Log-Information Working-Directory is $WorkingDirectory;


Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation