orchard cms Visual Studio team services - orchardcms

We have a number of Orchard projects that we want to get on Continuous integration using Visual studio team services and octopus deploy but its proving to be a headache (Like most things in Orchard)
In the build step we are running the orchard.proj file with the target precompiled (/t:precompiled)
Is anyone aware of any good documentation that can help us achieve our goal or have any tips?
Many thanks

Based on this article, you can run build precompiled command (build.cmd file is existing in project/solution folder) to build project (I made a test with Orchard 1.10.1). So you can add Command Line task/step to your build definition to run build precompiled command.
To deploy project to IIS, you could use IIS Web App Deployment task. (You need to install IIS Web App Deployment Using WinRM extension, then add IIS Web App Deployment task/step to your build definition)

Related

How do I deploy my website using MSBuild in TeamCity

I am trying to use teamCity to deploy my Visual Studio C# solution to my website.
The difficult part is that the solution is composed of 4 project snd one website.
If I try to use MSBuild witn /P params on the solution.sln it does not upload the website, it does however compile the other 4 projects. I have tried using MSBuild and specifying the name of the website .csproject but here is the trick, I don't have a .csproject for the website because it was added to the solution as a 'new website' and not 'new web application' so there is no project file for the website itself.
How can I achieve this ?
Thanks
Pat
Check the Microsoft Docs for ASP.NET Web Deployment using Visual Studio: Command Line Deployment

Deploying .Net Core to Linux WebApps on Azure with DevOps

I have a build/release for a .Net Core WebApp that works on windows machines perfectly, however I want to be able to deploy the same codebase to Linux. I set up a build and release and am using the "Web App on Linux" to deploy to my Linux WebApp. I also made sure that the Runtime Stack(s) on BOTH the Build and on the WebApp are set to use .Net Core 2.2:
The builds and the release run perfectly, however once the deployment is complete the website goes to a 404 (replacing the default Azure startup HTML page). I've FTP'd into the WebApp and see that the files are deployed to the machine, however I see that there are multiple "wwwroot" folders:
The top "wwwroot" folder does contain the DLLs for my application so that is a good sign:
Curiously I can get to the static files from my app such as the CSS, JS or the favicon if I navigate to /wwwroot/(filename)
I am pretty sure I have everything set up properly so I am hitting a wall on things to try. I've never had issues like this deploying to Windows WebApps so I am sure there is a setting or something that I am unaware of or is missing from the documentation.
For further details on this issue here is my BUILD:
...and my RELEASE setup:
I had a similar issue and the issue came down to how VS was publishing the zip vs Dev Ops. If you return to the Azure portal you will need to add a startup command specifying where your main DLL is located.
https://learn.microsoft.com/en-us/azure/app-service/containers/app-service-linux-faq#built-in-images

Visual Studio 2015 Preview - Full IIS

Any idea how to run ASP.NET 5 project in full IIS (not express) from within Visual Studio 2015 (via start debugging with F5 key)?
Atm I'm getting:
Couldn't determine an appropriate version of KRE to run.
I know it's not officially supported yet, but since IIS Express can do it, so should full IIS?!?
Let's say you created an ASP.NET 5 web application out of the template provided in VS 2015 Preview, then you can follow either of the approaches below:
Run the kpm pack command to create the deployable package with the appropriate options.
Example:
kpm pack --runtime KRE-CLR-x86.1.0.0-beta2-10690 --out "C:\MyWebApps\WebApplication1" --wwwroot-out wwwroot --configuration Release
Right click on the web application project and do a Publish to local file system directory.
Once the above step is done, in IIS, you can create a virtual directory application (or Website if you wish) to this deployable package's wwwroot folder. Example: "C:\MyWebApps\WebApplication1\wwwroot"
I just had a similar issue with beta4.
Note that the names have changed now so instead of a KRE it's now a DNX, although IIS was still showing the error calling it KRE despite this.
Anyway the solution for me was to:
right click the project in question in Solution Explorer
select "project name" Properties
tick Use Specific DNX version
tell it exactly which one you want to use, for me that was 1.0.0-beta4, .NET Core, x64
The project then ran in the browser for me.

TFS/MSBuild build/publish web deploy does not transform the web.config files

I'm trying to deploy a two-websites project in a Visual Studio 2012 solution via TFS as part of a build. We're at the point where we have two different web servers, WIP (work in progress) and DEV.
We want to deploy different connection strings to either server so they can connect to different databases. We've tested our solution on a development machine with Visual Studio and for all configurations, when any web project is published, the web.config connection string is transformed as expected when we check the web server.
The build is working fine on the WIP server which uses the default Debug solution configuration. The configuration in the TFS Build is Any CPU|Debug.
For the next configuration (DEV), we are sure that the web projects both publish via Visual Studio 2012 to the web servers and that the web.config files transform.
However, when we run the DEV build using MSBuild arguments, we notice that no transformation happens. We've sent the configuration in the Items to Build section of the build to: Any CPU|Dev.
/p:VisualStudioVersion=10.0 /p:DeployOnBuild=True;PublishProfile=app.ui.dev.pubxml /p:DeployTarget=MsDeployPublish /p:MsDeployServiceUrl=https://server-dev-hrtech:8172/MSDeploy.axd /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=WMSVC /p:AllowUntrustedCertificate=True /p:Username=username /p:Password=password /p:_WPPCopyWebApplication=True /p:PipelineDependsOnBuild=False
When we look at the build log and output directories - we can see compiled assemblies in the obj/Debug directory and not the obj/Dev directory as we'd expected. In the logs, we can clearly see /p:Configuration="Dev" as we'd expect.
The bottom line is the published web.config that ends up on the web server is the default web.config file from the Debug configuration (that is, untransformed). It is as if MSBuild is unable to see the configuration parameter passed in the arguments for the solution.
I've now tried running msbuild from the command line on my development machine to try and understand why this would happen.
By stripping back the MSBuild parameters that are sent via the TFS build, I can see that this doesn't transform the web config:
msbuild "app-no database.sln" /t:app_ui:Rebuild /P:TransformConfigFiles=true /p:Configuration=Dev /p:Platform="Any CPU" /p:MSDeployServiceUrl=https://app-dev-hrtech:8172/MSDeploy.axd /p:Username=username /p:Password=password /p:DeployOnBuild=True /p:PublishProfile=app.ui.dev.pubxml /p:VisualStudioVersion=11.0 > build.log
I can modify this and use MSBuild to build the project file directly. I've discovered that the command below does transform the web.config file for the published application:
msbuild app.ui\app.ui.csproj /p:Configuration=Dev /p:MSDeployServiceUrl=https://app-dev-hrtech:8172/MSDeploy.axd /p:Username=username /p:Password=password /p:DeployOnBuild=True /p:PublishProfile=app.ui.dev.pubxml /p:VisualStudioVersion=11.0 /p:AllowUntrustedCertificate=True > build.log
The problem is this would be difficult to run as part of a TFS build where they are multiple projects which some for websites and others for Windows servers, etc.
How can I use the first command, but amend it so that it properly transforms the web project?
As you can see I've created some publish profiles, so potentially they can be used in the MSBuild arguments as well in the TFS Build.
PS: we're using Visual Studio 2012, TFS 2010, Windows 2008R2 for servers and Windows 7 for development machines.
I've encountered this problem, regarding how to publish a web site through Publish Profile file, this article is the best one I ever saw.
For you case, it seems that you need to make the profile name same as the configuration name, e.g. use Dev.pubxml and Web.Dev.config.
/p:DeployOnBuild=True;PublishProfile=app.ui.dev.pubxml
I dont think that .pubxml should be at the end of the profile.
Should be like this
/p:DeployOnBuild=True;PublishProfile=app.ui.dev
It looks like TFS 2010 Build doesn't call the Transform MSBuild task by default. You need to edit either your TFS build defintion to add a new activity which calls it or edit your project file to do this.
Stack Overflow question TFS Build not transforming web.config as expected should help you with adding the new acitivty and blog post Integrating Web Config Transformations with TFS Build for making changes to the project file.
I just had this problem. Checked the MSBuild logs, checked making a local ZIP package, checked Web Deploy push to remote IIS and it was always using the default config file!
Turned out that the lump of XML I was looking at to check for my QA settings was lacking the xdt:Transform="Replace" attribute!
Hope this helps someone.

Automatic update-database in continuous deployment with Visual Studio 2012 and TFS 2012

Some weeks ago, I used the following steps to publish our developers' application to our testing Web site.
Get Latest Version (Recursive) in Solution Explorer.
Run Update-Database in Package Manager Console.
"Publish..." in Solution Explorer.
This worked but we decided to automatize this with Continuos Integration in a build definition. I put the following MSBuild arguments into the build definition
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:MSDeployPublishMethod=WMSvc
/p:CreatePackageOnPublish=True
/p:DeployIisAppPath="MyProject-testing"
/p:MsDeployServiceUrl=tfs.mydomain
/p:username=Administrator
/p:password=MYPassw!
/p:AllowUntrustedCertificate=True
/p:SkipExtraFilesOnServer=True
After some actions on the server tfs.mydomain, the executables and many other files of the application started appearing on the server automatically via the build definition. All except the database started being refreshed on the server automatically via the build definition. The application worked if there were no need to update database. But the updates are needed sometimes.
How can I modify the mentioned build definition to make the database up-to-date automatically what I did manually with Update-Database in Package Manager Console?
Thank you if you answer.

Resources