<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[ALM - Deltacode Blog]]></title><description><![CDATA[A web developer's blog by David De Sloovere]]></description><link>https://blog.deltacode.be/</link><image><url>https://blog.deltacode.be/favicon.png</url><title>ALM - Deltacode Blog</title><link>https://blog.deltacode.be/</link></image><generator>Ghost 3.35</generator><lastBuildDate>Tue, 09 Jun 2026 01:24:58 GMT</lastBuildDate><atom:link href="https://blog.deltacode.be/tag/alm/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Tag sources on build in Azure YAML Pipelines]]></title><description><![CDATA[Tagging Git sources with build number after successful build with Azure Pipelines YAML.]]></description><link>https://blog.deltacode.be/2020/10/09/tag-source-on-build-in-azure-yaml-pipelines/</link><guid isPermaLink="false">5f8068f71b45091b00a8e4c6</guid><category><![CDATA[Pipelines]]></category><category><![CDATA[Azure DevOps]]></category><category><![CDATA[Git]]></category><category><![CDATA[ALM]]></category><dc:creator><![CDATA[David De Sloovere]]></dc:creator><pubDate>Fri, 09 Oct 2020 14:20:31 GMT</pubDate><media:content url="https://blog.deltacode.be/content/images/2020/10/carbon.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.deltacode.be/content/images/2020/10/carbon.png" alt="Tag sources on build in Azure YAML Pipelines"><p>With the classic UI builds, we could easily access the option to tag source with every build or successful build.</p><figure class="kg-card kg-image-card"><img src="https://blog.deltacode.be/content/images/2020/10/image.png" class="kg-image" alt="Tag sources on build in Azure YAML Pipelines"></figure><p>When using Azure YAML Pipelines, this is still possible, but you really have to go out of your way to get to that option. From the YAML edit screen you'll need to go to the Triggers option via the kebab menu icon. After this you'll find the Tag sources option in the same place as before.</p><figure class="kg-card kg-image-card"><img src="https://blog.deltacode.be/content/images/2020/10/image-1.png" class="kg-image" alt="Tag sources on build in Azure YAML Pipelines"></figure><h2 id="self-checkout">Self checkout</h2><p>However, there is an undocumented way of doing this straight in the YAML. <br>You'll need to add an explicit step to checkout the code at the end of your build steps. Call the <code>git tag</code> command to add the (lightweight) tag from the command line, followed by a <code>git push</code>. Here's a slimmed down version using PowerShell:</p><!--kg-card-begin: markdown--><pre><code class="language-yml">steps:
- checkout: self
  clean: true
  persistCredentials: true

# restore, build, test, pack and push go here

- powershell: |
    Write-Host &quot;Tagging Build: $env:BuildNumber&quot;

    git tag $env:BuildNumber
    git push origin $env:BuildNumber
  env:
    BuildNumber: $(Build.BuildNumber)
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
</code></pre>
<!--kg-card-end: markdown--><h2 id="permissions">Permissions</h2><!--kg-card-begin: markdown--><p>You need the Git 'GenericContribute' permission to perform this action.</p>
<!--kg-card-end: markdown--><p>The <code>persistCredentials</code> option is required to allow all steps after the checkout to have access to the auth token for the <code>git push</code> operation.</p><p>You'll also need to set the <em>Contribute</em> permission to <em>Allowed</em> for the Build Service user .</p><figure class="kg-card kg-image-card"><img src="https://blog.deltacode.be/content/images/2020/10/image-3.png" class="kg-image" alt="Tag sources on build in Azure YAML Pipelines" srcset="https://blog.deltacode.be/content/images/size/w600/2020/10/image-3.png 600w, https://blog.deltacode.be/content/images/size/w1000/2020/10/image-3.png 1000w, https://blog.deltacode.be/content/images/2020/10/image-3.png 1275w" sizes="(min-width: 720px) 720px"></figure><p>A big advantage of placing the tagging inline is that I can now <strong>use the same YAML file </strong>for CI builds on Pull request and CD builds for approved PRs that go into <code>master</code>.</p><p>More information about the checkout step: <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&amp;tabs=schema%2Cparameter-schema#checkout">https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&amp;tabs=schema%2Cparameter-schema#checkout</a></p><p>PS: You can use PowerShell Core if you need cross-platform. Or switch to bash.</p>]]></content:encoded></item><item><title><![CDATA[Fix slow startup of ASP.NET MVC 5 on Azure App Services]]></title><description><![CDATA[I will show you how to speed up your web site start up time using view compilation. Because Azure App Service disc IO is slow, this will make a big impact.]]></description><link>https://blog.deltacode.be/2017/01/08/fix-slow-startup-of-asp-net-mvc-5-on-azure-app-services/</link><guid isPermaLink="false">5f777fee6d3795227c24a4e3</guid><category><![CDATA[ALM]]></category><category><![CDATA[MVC]]></category><category><![CDATA[Azure]]></category><dc:creator><![CDATA[David De Sloovere]]></dc:creator><pubDate>Sun, 08 Jan 2017 11:16:37 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p><em>You've deployed your MVC 5 website to Azure App Service (via Team Services); with pride you visit the site and start clicking... But wait, it's so slow even though you've done everything right, and 'it works on my machine'. Maybe you even scaled up from the free or shared tier, but it's still too slow.</em></p>
<h3 id="introduction">Introduction</h3>
<p>I will show you how to speed up your web site start up time using view compilation. Because Azure App Service disc IO is slow, this will make a big impact. It'll improve startup on other servers too. <strong>The homepage of my application starts up in 13 seconds now, before it was close to 30 seconds!</strong> How I 'measured' this is for another post.</p>
<p>If you publish via Visual Studio, you only need to set the correct checkboxes. You can read this excellent <a href="http://gunnarpeipman.com/2016/08/asp-net-mvc-precompiling-views/">blog post by Gunnar Peiman</a> for some more background information and instructions. But we all know that publishing from Visual Studio isn't the correct way, right? Friends don't let friends 'right-click publish'. Just rub some DevOps on it (TM Donovan Brown)!</p>
<h3 id="build">Build</h3>
<p>I'm using the Team Services build system for this project. It's easy to set up the initial build pipeline, because you can pick a template to start from. The one I used is Azure WebApp under Deployment.</p>
<p><img src="https://blog.deltacode.be/content/images/2017/01/2017-01-08-12_08_47-Start.png" alt></p>
<p>It has steps for nuget restore, build, tests, deployment and publishing the artifact back to Team Services to store with your build results. The hosted build agent, free for up to 240 minutes a month, offers what I need.</p>
<p><img src="https://blog.deltacode.be/content/images/2017/01/2017-01-08-12_23_28-Start.png" alt></p>
<p>Instead of going through the edit build, execute build, check output loop on Team Services, I just opened a 'developer command prompt' that has msbuild.exe in the path and started looking for the right combination of parameters. Yes, our goal can be achieved just by adding MSBuild arguments.</p>
<p><em>Disclaimer</em></p>
<p>Builds will be slower, about 30-40 seconds for me. But it'll make your site start up faster because you've moved some workload from the webserver to the build server. So it's worth it.</p>
<h3 id="step1">Step 1</h3>
<p>Add <strong>/p:MvcBuildViews=true</strong>. Just to tell you the difference between building views and precompiling views.</p>
<pre><code>msbuild.exe build.sln /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PackageLocation=&quot;C:\out\\&quot; /p:platform=&quot;any cpu&quot; /p:configuration=&quot;release&quot; /p:VisualStudioVersion=&quot;14.0&quot; /p:MvcBuildViews=true
</code></pre>
<p>This will build your views and give you compile-time errors of issues in your views. Let's say you mistype a variable name, you'd normally only see this at run-time (after deployment). With this option, the build will fail and you won't have a deployment with an error in a view. <em>This will not make your site or pages load faster</em>.</p>
<h3 id="step2">Step 2</h3>
<p>Replace with <strong>/p:PrecompileBeforePublish=true</strong>.</p>
<pre><code>msbuild.exe build.sln /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PackageLocation=&quot;C:\out\\&quot; /p:platform=&quot;any cpu&quot; /p:configuration=&quot;release&quot; /p:VisualStudioVersion=&quot;14.0&quot; /p:PrecompileBeforePublish=true
</code></pre>
<p>This will not only build your views, but also put them into a dll. No more dynamic compilation by the server at runtime (aka at request time).</p>
<p><img src="https://blog.deltacode.be/content/images/2017/01/precompile-1.png" alt="Output of precompiled views"></p>
<p>For every view you'll get one dll. The more dlls the server has to load, the slower. So let's merge them into a single dll.</p>
<h3 id="step3">Step 3</h3>
<p>Add <strong>/p:UseMerge=true /p:SingleAssemblyName=AppCode</strong></p>
<pre><code>msbuild.exe build.sln /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PackageLocation=&quot;C:\out\\&quot; /p:platform=&quot;any cpu&quot; /p:configuration=&quot;release&quot; /p:VisualStudioVersion=&quot;14.0&quot; /p:PrecompileBeforePublish=true /p:UseMerge=true /p:SingleAssemblyName=AppCode
</code></pre>
<p>All the App_Web dlls have been merged into a single dll. Also notice that the App_global.asax.dll file is gone now, it's been merge into AppCode too. In the build log you'll see calls to aspnet_compiler.exe and aspnet_merge.exe.</p>
<p><img src="https://blog.deltacode.be/content/images/2017/01/precompile-merge-1.png" alt></p>
<h3 id="cshtml">.cshtml</h3>
<p>What happened with the .cshtml files? Well they are still in the same place as they were, but they have been changed. If you open one of the views you'll see that it contains a placeholder text. This is to indicate that the views have been precompiled. And also make it clear that you don't have the option anymore to edit the view for a quick fix directly on the web server (precompiled, remember?). You'll have to follow your CI/CD flow (like a pro).</p>
<p><img src="https://blog.deltacode.be/content/images/2017/01/cshtml-placeholder.png" alt></p>
<p>You'll also find a .compiled file in the bin folder for every view. It contains XML that links the .cshtml file to the compiled class in the AppCode assembly file.</p>
<h3 id="summary">Summary</h3>
<p>Add this to the build parameters and you'll have a ASP.NET MVC 5 that will start up faster and every new page will load faster.</p>
<p><code>/p:PrecompileBeforePublish=true /p:UseMerge=true /p:SingleAssemblyName=AppCode</code></p>
<p><img src="https://blog.deltacode.be/content/images/2017/01/2017-01-08-10_01_10-Edit-GamePrijzenWeb-Deploy.png" alt></p>
<p>Full list of msbuild arguments in Team Services build:</p>
<p>/p:PrecompileBeforePublish=true /p:UseMerge=true /p:SingleAssemblyName=AppCode /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=&quot;$(build.artifactstagingdirectory)\&quot;</p>
<h5 id="protip">ProTip</h5>
<p>Keep your site alive by using a monitoring tool like <a href="http://www.uptimerobot.com">uptimerobot.com</a> or <a href="https://blog.deltacode.be/2017/01/08/fix-slow-startup-of-asp-net-mvc-5-on-azure-app-services/appbeat.io">appbeat.io</a> (which runs on .NET I believe) ! Their free tier allow checks at a 5 minute interval, which should be enough to keep it running.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Include .pdb files in Web Application Publish for Release mode (VS2012)]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>While most people want to get rid of the <strong>pdb files in release mode</strong>, I want to <strong>keep them</strong>. They don’t impact the performance of the application. They offer very useful information when exceptions occur. Etc..</p>
<p>In Visual Studio 2012, the .pdb files where excluded when publishing web applications</p>]]></description><link>https://blog.deltacode.be/2012/09/26/include-pdb-files-in-web-application-publish-for-release-mode-vs2012/</link><guid isPermaLink="false">5f777fee6d3795227c24a4d9</guid><category><![CDATA[.NET]]></category><category><![CDATA[ALM]]></category><category><![CDATA[debug]]></category><category><![CDATA[release]]></category><category><![CDATA[vs2012]]></category><dc:creator><![CDATA[David De Sloovere]]></dc:creator><pubDate>Wed, 26 Sep 2012 17:05:12 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>While most people want to get rid of the <strong>pdb files in release mode</strong>, I want to <strong>keep them</strong>. They don’t impact the performance of the application. They offer very useful information when exceptions occur. Etc..</p>
<p>In Visual Studio 2012, the .pdb files where excluded when publishing web applications in release mode.The development of these web applications was started in Visual Studio 2010 and I never had this problem. Somehow something changed after the solutions/projects very opened in VS2012.</p>
<p><a href="http://res.cloudinary.com/dij0bp3cb/image/upload/v1399921093/publish-web-application-dialog_rh7t6k.png"><img src="http://res.cloudinary.com/dij0bp3cb/image/upload/h_233,w_300/v1399921093/publish-web-application-dialog_rh7t6k.png" alt="Publish Web Application dialog" title="Publish Web Application Dialog"></a></p>
<p>Under the <em>Project Properties &gt; Build &gt; Advanced</em>, the ‘Debug Info’ was still set to ‘pdb-only’. So building in release does create the .pdb files.<br>
However, when running the ‘publish’ to deploy to file system (in context menu of the project, under the build menu) the .pdb files are not copied.<br>
They don’t appear on the destination folder which makes sense because they aren’t even copied to the ‘obj\Release\Package\PackageTmp\bin’.<br>
But why are they not copied to the package folder?</p>
<p>Like a lot of things, the answer is very simple and the solution even more so.<br>
After digging around, I noticed a new option in Visual Studio 2012 for Web Publish: <strong>exclude generated debug symbols</strong>.<br>
New option? Ok, not really. I just never saw it before. Turns out was there in Visual Studio 2010 also. But when converting my projects, this option got enabled somehow.</p>
<p>You can find this option under the <em>Project Properties &gt; Package/Publish Web</em>.<br>
<strong>Just uncheck the checkbox “Exclude generated debug symbols” and your .pdb files will be published</strong> like before.</p>
<p><img src="https://res.cloudinary.com/dij0bp3cb/image/upload/v1399921095/exclude-generated-debug-symbols_rqtjbu.png" alt="Uncheck the 'Exclude generated debug symbols' checkbox to include .pdb files in your publish." title="Exclude generated debug symbols"></p>
<p><em>‘Exclude generated debug symbols’ checkbox to include .pdb files in your publish.</em></p>
<p>Great, I’ve got my useful info back in the stack trace of exceptions! And so do you I hope.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[NuGet package restore fail TFS Build Server]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>If you don’t want to check-in packages into your source control system, you can <a href="http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages" title="Using NuGet without committing packages to source control">enable package restore</a>. This will automate the download of packages during build, if packages aren’t on the machine yet.</p>
<p>After enabling this for a solution I’m working on, I had no problem running</p>]]></description><link>https://blog.deltacode.be/2012/07/10/nuget-package-restore-fails-on-tfs-build-server/</link><guid isPermaLink="false">5f777fee6d3795227c24a4d8</guid><category><![CDATA[ALM]]></category><category><![CDATA[NuGet]]></category><category><![CDATA[TFS]]></category><dc:creator><![CDATA[David De Sloovere]]></dc:creator><pubDate>Tue, 10 Jul 2012 12:47:01 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>If you don’t want to check-in packages into your source control system, you can <a href="http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages" title="Using NuGet without committing packages to source control">enable package restore</a>. This will automate the download of packages during build, if packages aren’t on the machine yet.</p>
<p>After enabling this for a solution I’m working on, I had no problem running this locally. I removed my original packages folder from disc, and the build succeeded because nuget.exe (reference in the build) was able to download the packages. However… <strong>this didn’t work on our tfs build server</strong>.</p>
<h2 id="nugetpackagerestorefrombuildservernotdownloadingpackages">NuGet package restore from build server – not downloading packages</h2>
<p>The log file showed the command that was run:</p>
<pre><code>&quot;C:Builds\1\TeamProjectName\TeamProjectName\_Dev\_CI\Sources\.nuget\nuget.exe&quot; install &quot;C:Builds\1\TeamProjectName\TeamProjectName\_Dev\_CI\Sources\src\TeamProjectName.Services\packages.config&quot; -source &quot;https://nuget.org/api/v2/&quot; -o &quot;C:Builds\1\TeamProjectName\TeamProjectName\_Dev\_CI\Sources\packages&quot;
</code></pre>
<p>After running this from the command prompt, the <strong>output folder</strong> (packages) was not only empty, it <strong>didn’t even exist</strong>. Worse, running the command didn’t even give a hint of a failure.</p>
<p><em>The solution for me:</em><br>
Starting with <a href="http://docs.nuget.org/docs/release-notes/nuget-2.0" title="NuGet 2.0 Release Notes">NuGet 2.0</a> there’s a new option to give NuGet <a href="http://blog.nuget.org/20120518/package-restore-and-consent.html" title="Package Restore and Consent">consent</a> to download packages: <strong>Allow NuGet to download missing files during build</strong>.<br>
These are the steps to fix this problem:</p>
<ul>
<li>Go to your build server (rdp or physical)</li>
<li>Start Visual Studio</li>
<li>Check the version of NuGet under Tools &gt; Extension Manager - Update to v2.0 if needed and restart Visual Studio</li>
<li>You might need to uninstall, restart and install if simple update doesn’t work.</li>
<li>Open up the NuGet settings under Tools &gt; Options &gt; Package Manager</li>
<li>Make sure the <strong>Allow NuGet to download missing files during build</strong> checkbox is <strong>checked</strong>.</li>
</ul>
<p>[<img src="http://res.cloudinary.com/dij0bp3cb/image/upload/v1399921096/nuget-package-restore-fail-tfs-build_oqzljq.png" alt="NuGet Package Restore" title="nuget-package-restore-fail-tfs-build">]</p>
<p>Possible solution if NuGet package restore fail on build server.<br>
Make sure the consent checkbox is checked.</p>
<h2 id="ifyourbuildrunsunderadifferentaccount">If your build runs under a different account</h2>
<p>Maybe you can’t/won’t run Visual Studio under the account the build runs. Or maybe visual studio isn’t even installed.<br>
NuGet will look for an environment variable as a workaround.<br>
Create an <strong>environment variable</strong> named ‘<em>EnableNuGetPackageRestore</em>‘ with the value ‘<em>true</em>‘.<br>
Right-click computer, properties, advanced system settings, environment variables, hit New under system variables, create the variable and reboot the machine.</p>
<h3 id="stillnotsolved">Still not solved?</h3>
<p>If this didn’t solve the problem, other things to try for your package restore to work on your build server:</p>
<ul>
<li>Check the <strong>NuGet.targets</strong> file in the .nuget folder. And look for <strong>PackageSource</strong>. You can specify repositories there if you have a custom NuGet gallery or need to reference MyGet or similar.</li>
<li>Check the firewall of proxy in your network. NuGet might be blocked.</li>
</ul>
<p><strong>Was this post helpful to you? Please let me know in the comments.</strong></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Find TFS ChangeSet based on Check-In Note]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Want to find a ChangeSet through a value you entered in Check-In Note? It’s not that hard, but it isn’t obvious to know where to look.</p>
<p>You must have the TFS Power Tools installed: <a href="http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f">Team Foundation Server Power Tools September 2010</a></p>
<p>In the command prompt or run dialog,</p>]]></description><link>https://blog.deltacode.be/2011/02/22/tfs2010-find-changeset-based-on-check-in-note-value/</link><guid isPermaLink="false">5f777fee6d3795227c24a4d5</guid><category><![CDATA[ALM]]></category><category><![CDATA[TFS]]></category><dc:creator><![CDATA[David De Sloovere]]></dc:creator><pubDate>Tue, 22 Feb 2011 16:31:48 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Want to find a ChangeSet through a value you entered in Check-In Note? It’s not that hard, but it isn’t obvious to know where to look.</p>
<p>You must have the TFS Power Tools installed: <a href="http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f">Team Foundation Server Power Tools September 2010</a></p>
<p>In the command prompt or run dialog, you execute:</p>
<pre><code>tfpt searchcs
</code></pre>
<p>This will bring up a very handy dialog, allowing you to set some filters, including the check-in notes.</p>
<p><a href="http://res.cloudinary.com/dij0bp3cb/image/upload/v1399921103/tfs2010-custom-note-search_bp53of.png"><img src="http://res.cloudinary.com/dij0bp3cb/image/upload/h_287,w_300/v1399921103/tfs2010-custom-note-search_bp53of.png" alt title="TFS 2010 - Custom Note Search w/ Power Tools"></a></p>
<p>TFS 2010 – Custom Note Search w/ Power Tools</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>