Tip: Force-reinstall NuGet balíčků

NuGet je skvělý package manager, ale někdy se nechová tak jak bychom chtěli a balíčky se stáhnou nekompletně nebo nejsou správně referencovány ve vašem projektu. Kdykoliv na toto narazíte, vyplatí se zkusit force-reinstall všech balíčků.

Ve Visual Studiu otevřete Tools -> NuGet Package Manager -> Package Management Console . V otevřeném okně Package Manager Console pak napište následující příkaz:

To projde všechny nainstalované balíčky ve vašem solution a přeinstaluje je.

Pokud chcete provést force-reinstall balíčků pouze pro jeden konkrétní projekt namísto celého řešení, můžete přidat přepínač -ProjectName:


Tip: Force-reinstall NuGet packages

NuGet is a great package manager, but sometimes it misbehaves and packages are either not properly downloaded or are not properly included in your project. Whenever you come across this, I recommend doing a force-reinstall of all packages.

In Visual Studio go to Tools -> NuGet Package Manager -> Package Management Console . In the Package Manager Console window then enter the following command:

This will go package by package and force-reinstall them the opened solution.

If you want to force-reinstall packages only for one specific project instead of the whole solution, you can add the -ProjectName switch:


Connect(); 2017

Another year has come and with it the fourth annual on-line Microsoft Connect conference. Between 15th and 17th November you could watch the newest goodness from Microsoft for all developers on all platforms.

Two main keynotes were dedicated to intelligent cloud and building intelligent applications of the future. Let’s see what Scott Guthrie (of course in his favourite red polo shirt) and other speakers have unveiled. Pokračovat ve čtení “Connect(); 2017”

Výběr formátu správy NuGet balíčků pro nové projekty

Nové Visual Studio 2017 přichází s podporou pro nový formát správy NuGet balíčků – PackageReference, který nahrazuje staré formáty Packages.config a project.json a přidává odkazy na balíčky přímo do projektového souboru. Tento formát by měl být do budoucna pro NuGet standardem (nebo-li, slovy NuGet týmu “the one NuGet standard to rule them all” 🙂 ), ale není podporován ve starších verzích Visual Studia. Podle vašho konkrétního scénáře můžete chtít zvolit vhodný formát správy balíčku přesně podle typu projektu, na kterém pracujete. Naštěstí Visual Studio právě tuto možnost nabízí pomocí nového nastavení. Pokračovat ve čtení “Výběr formátu správy NuGet balíčků pro nové projekty”

Choosing NuGet package management format for new projects

The new Visual Studio 2017 comes with support for a new PackageReference package management format, which replaces the old Packages.config and project.json formats and puts the package references directly in the project file.This is bound to be the standard for NuGet in the future (or the one NuGet standard to rule them all, as they say 🙂 ), but is not supported in older versions of Visual Studio. Depending on your scenario, you might want to choose the appropriate package management format that suits your needs. Luckily, Visual Studio offers you this option via a new setting. Pokračovat ve čtení “Choosing NuGet package management format for new projects”

Použití vlastního nuget.exe v konfiguraci buildu na VSTS

Krátce po vydání Visual Studia 2017 přidal tým Visual Studio Team Service nový hostovaný build agent Hosted VS2017 který zahrnuje podporu pro všechny nejnovější verze vývojářských nástrojů Microsoftu. Bohužel, přestožee build task pro Visual Studio build novou verzi 2017 podporuje, nejnovější verze NuGetu ještě přidána nebyla. Naštěstí je ale možné při buildu použít vlastní nuget.exe a použít jej pro restore balíčků projetku, který používá nové <PackageReference> v projektovém souboru csproj. Pokračovat ve čtení “Použití vlastního nuget.exe v konfiguraci buildu na VSTS”

Using custom nuget.exe in VSTS build process

Soon after the release of Visual Studio 2017, the Visual Studio Team Services team has added a Hosted VS2017 build agent that has support for all the latest and greatest technologies. Unfortunately although the build task with Visual Studio 2017 is itself present, the newest version of NuGet wasn’t added, yet. Fortunately, it is possible to use a custom nuget.exe to circumvent this issue and be able to restore packages for project using the new csproj format with <PackageReference>. Pokračovat ve čtení “Using custom nuget.exe in VSTS build process”

Summary of Microsoft Connect(); // 2016

From 16. 11. to 18. 11. 2016 the third year in a row the Microsoft Connect(); developer conference took place in New York and had been streamed on-line.

The team responsible for the conference promised content full of surprises, announcements and interesting sessions and I can honestly say that they did deliver.

The main keynote was traditionally led by Scott Guthrie and Scott Hanselman. Let’s do a recap of the most interesting things we have learnt!

Any developer. Any app. Any platform.

This is the new mantra of Microsoft in the world of mobile and cloud development. The goal is to provide the best tools to every single developer. Whether you are building a mobile app for Windows, Android or iOS, desktop app for Windows or Mac, web app in ASP.NET or Node.js, or a cloud solution on Microsoft Azure, whether you prefer PC or Mac or Linux, Microsoft tools are at your service.



What a few years ago no one would predict or probably even dare to say as a joke has become a reality – Microsoft is the most active organization on GitHub with over 16 400 contributors and has become a platinum member of the Linux Foundation.

screen-shot-2016-09-15-at-5-53-28-pmThe importance of open-source software is clear and Microsoft values the opportunity to work with the wide developer community.

The New Microsoft is open-first.

Visual Studio

The Visual Studio family of integrated development environments (IDEs) is the cornerstone of development in Microsoft technology stack and the conference therefore dedicated a substantial time showing the newest updates of the IDEs.

Visual Studio Code

Up until now the youngest member of the Visual Studio family – Code – has been able to grow up in the 18 months on market and provides a fast and lightweight developer tool for all operating systems. Because the project is fully open-source, it is improving really fast. Git, GitHub and Azure integration, smart IntelliSense and hundreds of extensions make Code an interesting alternative even to larger IDEs.

The versatility of the tool was demonstrated during the keynote by building a Node.js app using MongoDB NoSQL database on Mac. The result was then deployed as a Docker container on a Linux server hosted on Microsoft Azure. Pretty cool, if you ask me.

Debugging in Visual Studio Code
Debugging in Visual Studio Code

Visual Studio 2017

The upcoming release of Visual Studio got its name – Visual Studio 2017. The release candidate version (RC) is available now on VisualStudio.com.

The new Visual Studio has been slimmed down and with the new modular installer you can install the IDE much faster with exactly the features you actually need. It is also very easy to later add new features or remove them as you see fit.

The IDE itself is substantially faster (and fluider), in many cases by an order of magnitude compared to 2015.

Visual Studio 2017 brings many improvements across the board.

Starting with the improved start page, with easier access to active repositories and recently opened solutions.


A welcome addition is the ability to edit .csproj project files right inside Visual Studio without having to unload the project.

Navigation features were also improved. The Find All References dialog for example now offers a cleaner hieararchical  preview of all found references.

findallrerencesCode blocks are now marked with Structure Guide Lines. Hovering the mouse over them gives you a hint of which code block they belong to. This substantially improves code readability.

structure_visualizer_cs_tooltipVisual Studio Extensions dialog was updated as well and allows for batch installations and updates of extensions without multiple restarts of the environment. Built-in is also the Roaming Extension Manager, which shows you the extensions you are using on other devices, but have not installed locally, yet.

The Extension manager is now also able to alert you when some extensions are slowing Visual Studio down and you can therefore resolve performance issues much more easily.

Extremely intriguing is the new Live Unit Testing feature of Visual Studio Enterprise 2017. This allows you to display the results of unit tests and code coverage in real-time while you code. After making changes to a code snippet, Visual Studio will automatically run the related Unit Tests in the background and will show the results using indicator on the left margin of the code. As far as I know, only nUnit offered this feature up until now and it is great to see it integrated into Visual Studio.

Exception handling was also substantially improved. The new dialog window offers more useful information about the exception.


For the full list of changes in Visual Studio 2017 RC see the Release Notes on the Visual Studio website.

Visual Studio for Mac

One of the biggest surprises of this year’s Connect(); (well, at least if you hadn’t seen the leaked announcement on a Microsoft blog 🙂 ) was the special version of Visual Studio for macOS.

Visual Studio for Mac brings developers the best IDE for Xamarin iOS and Android app development and ASP.NET Code web app development on Mac.


Preview version is available for you to try out now. Final release of the product will be free as part of the Visual Studio subscription. A free Community edition will also be available.


With Xamarin developers can build native mobile apps in C#. The platform is used by thousands of developers and companies all over the world. Thanks to the Microsoft’s acquisition of Xamarin in February both companies have been now working even closer together.

The open-source Xamarin.Forms framework is getting a lot of attention. This frameworks allows you to build cross-platform apps, which share not only the business logic in C#, but also the user interface (UI) in XAML.

In Visual Studio 2017 you will find the long awaited Xamarin Forms Previewer, which provides live rendering of XAML interface. You will no longer have to enter the inconvenient “change-and-run” loop and you will get immediate feedback on your edits.

xamarinpreviewerWith the new Xamarin Inspector you can browse and edit XAML hierarchy of a running app. The tool can display a 3D model of the layers the app consists of. Every change can be persisted to the source code as well.

xamarininspectorRemote iOS Simulator for Visual Studio Enterprise is now stable. You can now easily test your iOS apps without leaving Visual Studio on Windows. This puts an end to the endless spinning between PC and Mac. Your chair will be grateful 🙂 .

simulatorNew tools also offer easier ways to debug your app and the backend simultaneously.

Many developers will also be pleased to know that Samsung is now contributing to Xamarin and has announced support of .NET Core for Tizen. This open-source operating system is built on Linux and runs on more than 50 million connected devices ranging from wearables, through home appliances to TVs. Xamarin.Forms now contains experimental support of Tizen, including the Visual Studio emulator.

Universal Windows Platform

UWP apps were not left behind with the Visual Studio 2017 update and got quite a few nifty improvements.

The .NET Native compiler received over 600 bug-fixes and improvements and brings even better performance and optimizations to UWP apps.

Application Manifest Designer now has a completely redone Visual Assets page. The new layout gives you an option to automatically generate image assets of all sizes based on one single image file. This is much easier than to manually create the appropriate sizes with the right padding around the image.

manifestvisualassetgeneratorNew diagnostic tool UI Analysis helps you identify XAML problems that could lead to hindered performance and usability of the application.

XAML Designer offers a color theme and high-contrast options for its preview. Also, the new Edit & Continue feature allows you to tweak XAML markup while the app is running. The changes are not only displayed live in the app, but can also be persisted.


IntelliSense is now also finally able to offer suggestions with the {x:Bind} syntax and can add missing namespaces automatically.

intellisense_without%20namespaceIf you use Appium, you can take advantage of improved UI testing of UWP apps. Using the Windows Application Driver can the test project launch and interact with your UWP app and perform your defined tests.

Visual Studio Mobile Center

Building a great mobile app requires in addition to its development also testing, distribution and monitoring. The new Visual Studio Mobile Center aims to help you with these tasks.

visual-studio-mobile-center2This cloud service, now available as a invite-only preview covers the whole mobile app lifecycle.

Currently the following features are present:

  • Build – continuous integration and release management
  • Test – automatic testing on real devices (using Xamarin Test Cloud)
  • Crash reporting – crash analytics in real time
  • Distribution – deployment to users and testers
  • Analytics – business and usage metrics
  • Authentication – integration with different authentication providers
  • EasyTables – easy cloud data storage

visual-studio-mobile-centerThe service supports Android and iOS apps written in Objective-C, Swift, Java, Xamarin and React Native. Support of UWP and Cordova apps is planned in the near future.

In addition to the website interface you can access all features of VSMC using its powerful REST API.

Microsoft Azure

Microsoft is trying to achieve maximum flexibility for customers with its cloud offerings. Azure has now 38 regions over the world (which is more than Google and AWS combined), more than 100 datacenters and is the only certified cloud offering in China. 90% of Fortune 500 companies is now using Microsoft Cloud and Azure adds 120 000 users monthly.

Docker is getting first-class support in Azure and Visual Studio. Services like Azure App Service can be easily integrated with Docker. Developers will be pleased to know that creating, testing and deployment of apps in Docker containers is just a few clicks away with the Visual Studio Tools for Docker. Visual Studio even allows debugging of code in multiple containers at the same time. Finally, Docker is now supported in Visual Studio Team Services continuous integration.

image_8220c68d-c750-43a9-9fd6-21af02268cadAzure Application Insights (web app analytics) and Team Foundation Server 2017 reached General availability (GA).

Azure Functions is a new Azure service, which allows you run code based on events (not only Azure-based, but also from third-party services or on-premise systems). The whole infrastructure is fully abstract, so your only job is to select an event you want to respond to and write the code that should be executed. You can write your event handler in JavaScript, C#, Python and PHP or use Bash, Batch or PowerShell scripting. The service scales automatically based on the incoming traffic and you pay only for the actual processing time.

azurefunctionsSQL Server 2016 is now for the sixth year in a row the safest database system. It offers advanced business intelligence (BI) analytical tools at a fraction of the price of competition. With the announced Service Pack 1 are these analytical features added to all editions of SQL Server – including the free-of-charge Express edition. A preview of SQL Server for Linux was also announced at Connect();, with Docker support, of course.

Azure Bot Service, now in GA, offers cloud-based Conversations-as-a-platform functionality. The services gives you the opportunity to build intelligent conversational bots for Skype, Slack, Facebook Messenger, Microsoft Teams and more. Everything is scaled automatically based on traffic.

Azure Data Lake Services are a new enterprise-grade service in GA, which offers effective storage and processing of enormous amounts of data.


Two years ago, .NET became open-source on GitHub and its community has been incredibly active and vibrant since then. Over 60% contributions to .NET Core has come from community.

Independent .NET Foundation organization supporting the open development and collaboration in the .NET ecosystem currently maintains over 400 repositories on GitHub and its Technical Steering Group consists of companies like RedHat, Samsung, JetBrains and Unity (and Microsoft, of course). What no one expected however – Google is now also becoming a member of .NET Foundation.

.NET Core 1.1 was released. It includes over 1 300 new APIs, better Azure integration and many performance enhancements. These are most prominently aparent in ASP.NET Core, which is now the tenth fastest web framework in the plain-text test from TechEmpower and was able to handle 1 822 366 requests per second. This is 850 times more than ASP.NET two years ago – an unbelievable achievement.

aspnetcoreperformance_techempower-f46b4c14f6f3bbaeNew version of MSBuild supports new version of the .csproj format, which is much simpler and more readable. Not a single GUID is required and the source-code files can be included in the project automatically using wildcard characters. This means the end of the oh-so-hated project file source control merge conflicts.


Connect(); //2016 was clearly the biggest yet. Whatever you are building, the new tools from Microsoft are here to help you do more and achieve more.

Visual Studio 2017, Visual Studio for Mac and Visual Studio Code bring the best IDEs for every opportunity and users on any operating system. With Xamarin it is the best place for mobile app development. Hand in hand with the Visual Studio Mobile Center cloud service you get the best means to cover the whole mobile application lifecycle.

Azure does keeps getting better with Docker, new Azure Functions, Azure Bot Service and Azure Data Lake Services.

Open .NET Core has sparked the interest of Google and Microsoft has become a platinum member of the Linux Foundation.

If you haven’t had a chance to watch Connect(); //2016 live, be sure to check out the on demand sessions, available at Channel9 and try out all the cool stuff that was announced.

Happy coding!


Jak opravit klávesové zkratky ve Visual Studiu, když ReSharper zlobí

Neodpustil bych si nezmínit, že ReSharper je úžasný a téměř neodolatelný nástroj pro vývoji v jazyce C#. Vylepšené fungování IntelliSense a automatické přidávání using direktiv jsou samy o sobě důvodem, proč jej mít nainstalovaný. Bohužel někdy ReSharper přestane dobře spolupracovat s výchozími klávesovými zkratkami Visual Studia. Po nové instalaci na počítač s jiným než americkým výchozím rozložením klávesnice často nefungují zkratky jako Ctrl + F (Quick Find).

Některé klávesnice totiž na psaní znaků jako jsou závorky vyžadují speciální kombinace znaků s Alt Gr. Například na výchozí české klávesnici lze levou hranatou závorku ( ‘[‘ ) napsat pomocí kombinace Alt Gr + F. Nějakým způsobem se toho ReSharper dovtípí a přiřadí příkaz, který se používá k přechodu k obsahující deklaraci (výchozí Ctrl + [) na kombinaci Ctrl + F a vynechá modifikátor Alt Gr.

Pokud se ocitnete v podobné situaci, je zde naštěstí snadné řešení! Nejprve změňte své rozložení klávesnice ve Windows na americké (US). Následně otevřte Visual Studio a v něm dialog Options přes menu Tools. Z levého seznamu možností vyberte Keyboard. V horním rozbalovacím seznamu vyberte preferované mapování kláves (obvykle ‘(Default)’) a klikněte na tlačítko Reset, potvrďte restart pomocí Yes a zavřete dialog přes OK.


Nyní pravděpodobně chcete obnovit také některé užitečné klávesové zkratky ReSharperu (nikod, kdo si jej nainstaloval, by nemohl žít bez všemocné zkratky Alt + Enter!). To můžete udělat přes menu ReSharper, volbu Options, vyberte vlevo Keyboard & Menus a nyní jen jednoduše vyberte vám nejbližší rozložení zkratek a klikněte na Apply Scheme a poté Save. Nyní můžete otestovat, zda předtím nefunkční příkaz již nyní funguje.


Lze se nyní také bezpečně vrátit na původní (ne-americké) rozložení klávesnice a funkčnost zkratek by měla být zachována.

How to fix Visual Studio shortcuts when ReSharper doesn’t play well

Let me say this – ReSharper is a wonderful and almost indespesable tool for C# development. The improved IntelliSense features and automatic using statements are themselves worth having it installed. But sometimes it stops playing well with Visual Studio keyboard shortcuts. Quite often shortcuts like Ctrl + F (Quick Find) shortcut stop working when Resharper is first installed on a PC with non-US default keyboard.

Some keyboards require different ways to write things like braces and similar. For example on the default Czech keyboard, you have to press Alt Gr + F to write the left square bracket ( ‘[‘ ). Somehow, Resharper for some accidental reason assigns the command it uses for containing declaration (which is normally written as Ctrl + [) to Ctrl + F leaving out the Alt Gr modifier. This way the shortcuts using these unusual characters get broken.

When you find yourself in such a situation, you can luckily fix it quite easily! First change your Windows keyboard layout to US. Then open Visual Studio and opent the Options dialog via the Tools menu. From the left hand pane select Keyboard. Here select the keyboard mapping scheme you prefer (usually ‘(Default)’) and click the Reset button, confirm with Yes and close the options dialog by clicking OK.


Now you probably want to also recover some of the useful ReSharper keyboard shortcuts (no one with ReSharper installed could just live without the all-mighty Alt + Enter shortcut!). You can do just that by going to the ReSharper menu, choosing Options, navigating to Keyboard & Menus and then simply select your preferred shortcut override, click Apply Scheme and Save changes. Now you can try out the command which was broken before and confirm it works well.


Now you can safely go back to the keyboard layout of your choice and the commands will be at your service.