Skip to main content

Posts

Showing posts from July, 2019

Azure DevOps Pipeline Build error: Unable to determine the location of vstest.console.exe

After replacing the existing build servers at one of my customers, some build started to fail with the following error message: Unable to determine the location of vstest.console.exe ---> System.IO.FileNotFoundException: Unable to determine the location of vstest.console.exe When looking at the build tasks, I noticed they were still trying to use Visual Studio 2015 to run their tests: On this new server we only had Visual Studio 2017 and 2019 installed, so Visual Studio 2015 was a ‘no-go’. To fix it, we changed the VSTest version to ‘Latest’:

Azure DevOps–Why is my database so big?

When preparing an Azure DevOps Server migration, the customer asked me why there Azure Devops databases grew so fast. There are 2 queries that can help you answer this question. The first query gives a general overview of the different parts: The output of the first query returned the following results in this case: Owner BlobSizeInMb VersionCVersionControl 64992.008339881835 FileContainer 59599.479797363281 TeamTest 44243.018857001953 WorkItemTracking 23674.237445831054 CodeSense 989.945262908203 ProcessTemplate 125.949053763671 Generic 54.288738250000 The second query goes in more detail to differentiate between source control and build: The output of the second query returned the following results in this case: FileContainerOwner

Azure DevOps Pipelines–How the build agent detects Visual Studio related capabilities

Detecting if Visual Studio is installed on the build server can be quite painful. I’ve seen a few times where the build agent didn’t pick up the Visual Studio installation, making the build server useless. As Visual Studio is not added to the capabilities of the build agent, the specific agent is never used to conduct a build. If everything is OK, you should see something like this in your Build Agent capabilities: But how does the build agent detects that Visual Studio is there? This is all done through vswhere.exe, a tool I blogged about before. Vswhere is installed as one of the tools of the build agent, but in case of trouble you can run it yourself to see what is going wrong. Let’s try this: Login on your build server and open the installation folder of one of your build agents. Go to the externals\vswhere  subfolder. Here you should find the vswhere.exe Let’s see what options are available by calling vswhere.exe –help : PS D:\builds\dev-agent-1\external

GraphQL–Use GraphQL playground to authenticate requests

I really like GraphiQL to play around and test my GraphQL endpoints in the browser(try a live demo here ). There is only one thing I really miss and that is the option to add extra headers when sending requests to your GraphQL endpoint. Why do I need this? One word; security. Most of my GraphQL endpoints are secured using oAuth. This makes using GraphiQL no longer an option as every request is answered by a 401 Unauthorized response. Luckily there are a lot of alternative libraries that offer similar functionality as GraphiQL. The one I like is GraphQL Playground . From the documentation: GraphQL Playground uses components of GraphiQL under the hood but is meant as a more powerful GraphQL IDE enabling better (local) development workflows. Compared to GraphiQL, the GraphQL Playground ships with the following additional features: Interactive, multi-column schema documentation Automatic schema reloading Support for GraphQL Subscriptions Query histo

GraphQL Documentary

Did I mention I’m a big fan of GraphQL? Now they even released a documentary: “Starring Lee Byron, Dan Schafer and Nick Schrock (co-creators of GraphQL) and other big names from the #GraphQL community, "GraphQL: The Documentary" explores the story of why and how GraphQL came to be and the impact it's having on big #tech companies worldwide, including Facebook, Twitter, Airbnb and Github.”

Selenium - OpenQA.Selenium.DriverServiceNotFoundException

With the announcement from Microsoft to stop supporting Coded UI tests , I’m back in Selenium land. To get it back in my fingers, I started to write a first simple Selenium test: But although this test looked quite simple, it failed with the following exception: Test Name:        TestMethod1 Test FullName:  SeleniumTestProject.UnitTest1.TestMethod1 Test Source:       C:\projects\test\SeleniumTestProject\UnitTest1.cs : line 10 Test Outcome:  Failed Test Duration:   0:00:00,2912324 Result StackTrace:          at OpenQA.Selenium.DriverService.FindDriverServiceExecutable(String executableName, Uri downloadUrl)    at OpenQA.Selenium.Chrome.ChromeDriverService.CreateDefaultService()    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)    at SeleniumTestProject.UnitTest1.TestMethod1() in C:\projects\test\SeleniumTestProject\UnitTest1.cs:line 15 Result Message:              Test method SeleniumTestProject.UnitTest1.TestMet

Tips from NDC Oslo 2019 - AZX

If you are using a Mac or Linux and want to use Azure, here is a tip for your: azx.ms From the Github repo : This utility is intended to help you create the scripts you need for Microsoft Azure. You can browse them online or install a quick utility function.

Microsoft Cloud Workshop

Interested in organizing your own Cloud workshop? Take a look at Microsoft Cloud Workshop , it contains a big library of workshop materials including presentation decks, trainer and student guides, and hands-on labs.

TFS - XAML Build controller stops working–Part 2

Yesterday I blogged about a problem that I had with the XAML Build controllers. I reconfigured the /queue what seemed to solve the problem. Unfortunately the problem reappeared after a few hours. Instead of getting a 404 error, this time the details exposed a 500 error code. In the logs I noticed the following error message: WebHost failed to process a request. Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/17729775 Exception: System.ServiceModel.ServiceActivationException: The service '/queue/SampleCollection/Services/v4.0/MessageQueueService2.svc' cannot be activated due to an exception during compilation.  The exception message is: Memory gates checking failed because the free memory (419909632 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on

Tips from NDC Oslo 2019 - Polly.NET policy wrapping

I do like Polly.NET , the “resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner”(quoted from the website ). One of the nice things you can do in Polly is combining multiple policies to achieve more complex functionality: This works but requires some ugly nesting. A better approach I learned at NDC was through PolicyWrap: More information here: https://github.com/App-vNext/Polly/wiki/PolicyWrap

TFS - XAML Build Controller stops working

When I started a XAML Build Controller on the build server, I noticed the following behavior: The controller and agents start up and change to the Ready state while the icons went green A few seconds later the icons turn red again, although the controller and agents remain in the same state. On the Build Controller, a details link appear that shows the following error message: TF400324: Team Foundation services are not available from server <Server/CollectionName>. Page not found So what was going on? Everything was caused by a change in IIS I did. Before the TFS server was hosted on https://mytfs.company.be/tfs but they wanted to get rid of the /tfs part. So I removed the tfs application from IIS and moved all services to the root of the site. This worked perfectly for TFS itself but caused issues for the build controllers. Why? Because there are in fact 2 applications that should be hosted: the root TFS webservices now hosted at https://m

Killing a hanging Windows Service

While testing a newly created Windows Service, the service failed on startup. As a consequence, I couldn’t start/stop/delete the service anymore. To fix it I had to jump through some hoops: First I had to query for all services to find the correct process id. This can be done using the sc queryex command This returned a list of all services: SERVICE_NAME: WpnUserService_ce0fb DISPLAY_NAME: Windows Push Notifications User Service_ce0fb         TYPE               : f0   ERROR         STATE              : 4  RUNNING                                 (STOPPABLE, NOT_PAUSABLE, ACCEPTS_PRESHUTDOWN)         WIN32_EXIT_CODE    : 0  (0x0)         SERVICE_EXIT_CODE  : 0  (0x0)         CHECKPOINT         : 0x0         WAIT_HINT          : 0x0         PID                : 8740         FLAGS              : SERVICE_NAME: FailingService.Host DISPLAY_NAME: FailingService.Host         TYPE               : 10  WIN32_OWN_PROCESS     

Azure Artifacts - Views

A nice feature of Azure Artifacts(part of Azure DevOps) is the support for Views. By using Views you can split out a feed into multiple parts. This allows you to do a controlled rollout of a new package. By default, Azure Artifacts provide 3 views: @local , @prerelease , and @release . This allows you to do package promotion: We’ll start with an automated deployment to the @local feed. When a package is ready for adoption, we can promote it to the @prerelease view: When the package is validated and ready for prime time, we promote it into the @release view. More information: Views on Azure DevOps Services Feeds Communicate package quality with release views

Tips from NDC Oslo 2019–F# Adding overloads to a discriminated union

A neat trick I noticed while watching the Dungeons, Dragons and Functions talk by Mathias Brandewinder is adding overloads to a discriminated union. In his talk, he is modelling Dungeons and Dragons using F#. One of the things he needs to model is a dice roll. In D&D you have uncommon dice shapes and inside the rule book you’ll find dice rules like:  4d6+2d10+8 . What does this formula means? 4 roles of a 6-sided dice + 2 roles of a 10-sided dice+ 8 To model this in F#, Mathias created the following discriminated union: You can then use this Roll type to create the formula above: This works but is not very readible. To fix this, Mathias introduced some overloads on the Roll type: This nicely cleans up the formula to: More information can be found in Mathias blog post here: https://brandewinder.com/2018/07/31/give-me-monsters-part-3/

Tips from NDC Oslo 2019–F# Interactive built-in constants

Reading other files through F# Interactive can be tricky when using relative paths. It’s hard to guess what F# Interactive will use as the working directory. Of course you can start using absolute paths but a better alternative is using the built-in constants; __SOURCE_DIRECTORY__ __SOURCE_FILE__ This allows you to do the following:

Tips from NDC Oslo 2019–Grid Garden

I have to admit that I’m really bad in CSS (although I was really proud on the linear-gradient I created 2 weeks ago). Before I always used the grid layout system of Bootstrap and didn’t worry to much about it. But I feel that the time is right to really start understanding Flexbox and the newer Grid Template . And what is a better way than through gamification. So stop disturbing me as I’m taking care of my carrots …