Team Services releasing wrong project in multi-project solution - asp.net-core

I've been setting up Continuous integration, and deployment in Team Foundation Server Online. When VSTSreleases the build to the DEV server (with the IIS Deployment template) the wrong project is being released.
The image below shows the project structure in my solution (asp.net core). I just need to deploy the WebApp.Web.MVC project which has dependencies on several other projects in the solution. Instead, VSTS deploys the WebApp.Application.Shared project.
I've tried moving the MVC project to the top of the list by putting an A in front of it. Also tried adding a parameter in the VSTS build definition with name 'Project' and value 'WebApp.Web.Mvc'. No results though.

So I've managed to solve this problem by doing the following:
I added an additional step in the build process, first the entire solution is build, and then the second step is to build only the MVC project by referring to the mvc.csproj. Now, only the MVC project and its dependencies are being released to the IIS website.
Entire solution
Only MVC project

Related

XUnit tries to add dlls to a TestProject

We have an Asp.net Core Project with a XUnit Test-Project. Since some Time, I think since updating to Asp.Net Core 2.1, we get the following Warning:
This Warning pops up every time we open the Solution in a new Branch and I have no clue how to get rid of it. Since both, the "Add" and the "Cancel" have no impact on the project.
Some more Data about the project:
.net Core 2.1
Xunit 2.4.0
TFS 2017
Visual Studio 15.8.6
Based on the error message seems the packages folder which contains the *.dlls or the test project is not mapped to the workspace.
Generally you need to map your workspace at the Project level. Please refer to this article on how to set up the source control folder structure.

Build solution with multiple projects

I have following project in one solution.
MVC Web Project
WPF Project
Library project common to both projects.
How can I build above projects & publish the output for MVC Web & WPF project to some directory using MSBuild command?
What you want is Maven. Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

Team City build with 2 web projects

Apologies if this is basic, but I seem to just be missing something.
I have a single solution with multiple class libraries and 2 MVC 4 web applications.
I've had one of those web projects for ages, and a Team City CI build that generates an artifact that I then deploy via Octopus Deploy. This works great.
I can't figure out the simplest way to either generate a 2nd artifact for the 2nd web project (same tc build, or a different one, I don't care).
End result: I want both web projects to be deployed to the same environments (IIS 7), with the 2nd site simply on a different port. I don't need TC to do anything special, just nuget restore, build, then generate the artifact.
If you always want to deploy both web applications at the same time. E.g they have some shared code libraries, then it's best to setup the deployments as multiple build configurations in a single project.
E.g
Build project A
Build project B
Deploy project A
Deploy project B
If you want to build and deploy the applications separately, then setup the two separate projects. This will allow you to have different build triggers, deploy schedules for both applications.
E.g.
Project A
Build
Deploy
Project B
Build
Deploy
In addition to this, you will need to have a nuget package for each web application. That means you need to run Octopack for each web app and have a nuspec file. Each project will need to generate its own nuget package artifact. In Octopus deploy, you need to either setup a single project with 2 steps or have 2 projects.

MSBuild: (WebDeploy) Web package creation for selected web projects

I managed to get TFS 2010 to create Web Deployment ZIPs (WebDeploy).
Now the issue is that I have multiple Web projects in the solution and packages are being created for all web projects.
In the projects that I do not want a package, I uncheck the "Create deployment package as a zip". I thought this will prevent MSBuild from creating a deployment package.
BTW I am passing "/p:DeployOnBuild=true" to MSBuild.
Is there a way to get MSBuild only package selected projects and not all Web projects?
Thanks.
Ok. Found the solution. Many thanks to Vishal Joshi for this post.
Extract from the post:
"
Deployment for Web Apps is feasible at both Solution as well as Project build level although when it comes to Solution Build then you might want to make sure that the properties you are passing at Solution level will apply to all the projects in the solution which might not always the outcome you desire. In that situation all these properties can be set within the .csproj or .vbproj files too. You can do that by unloading your project file and in the top <PropertyGroup> section just add above properties as you like:
For e.g /p:DeployOnBuild=True can be added as <DeployOnBuild>True</DeployOnBuild>
"
So, the solution was to remove /p:DeployOnBuild=true from TFS Build process template and update only the project files that require a package.

Minifying and Including js and css files on Azure Project

I'm using YUI Compressor as a MsBuild Task on my Azure project. It works well on locally but when I try to publish it I cannot insert minified packages to my azure application package. Although I have tried a lot of things about package modifying on my .csproj file I couldn't work it out. How can I do this?
Edit:
My project is not a MVC or Webforms application. Just HTML and Javascript inside of an ASP.NET project. My problem is not minification. It is just placing minified external files in Azure Package when publishing it but if there is any other method that solves this azure problem, I can change YUI Compressor with ajaxmin or google closure... doesn't matter.
I don't think modifying the service package is supported (you are also modifying the manifest). That's why I would look at it from an other perspective. I'm assuming you have such a setup:
Solution
Empty ASP.NET Project
Index.html
App.js
Now, after you compile (and the MSBuild task runs) you'll have something like this:
Solution
Empty ASP.NET Project
Index.html
App.js
App.min.js (not included in the project, but available on the file system)
Now, buy simply including the App.min.js file in the project, it will be included in the service package when packaging or publishing your application. And besides that, the MSBuild tasks runs each time you compile, meaning the file will be updated before each time the application is packaged.
As you haven't specified about about whether it is WebForms or MVC, I would like to point out the out of the box support for the bundling and minification in ASP.net MVC4. Scott Gu has explained it the MVC4 preview demo.
You can also tweek it to work a way for that in ASP.net MVC3 too. Once this is achieved, you can achieve that in Azure as well.
Additional Articles :
ASP.NET MVC4 bundling in ASP.NET MVC3
New in ASP.NET MVC4: Bundling and Minification