Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    buildmastermicrosoftmsbuildnet
    6 Posts 1 Posters 19 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        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".

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            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 :)

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • ? This user is from outside of this forum
                Guest
                last edited by

                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;
                
                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post
                Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation