26/12/2016

Migration to Nuget V3

Home


Source: own resources, Authors: Agnieszka and Michał Komorowscy

Sometime ago I wrote a post about My struggels with GitHub, Subtrees and Nuget and Joseph suggested me another solution of my problem in the comments i.e. to switch to Nuget V3. A few days ago I finally found time to give it a try. I started by reading this tutorial/post written by Oren Novotny. It's really a good source of knowledge so I'll not describe the whole process again. However, I encountered 3 problems that weren't described and I'll briefly write about them.

Project.json vs Project.config

A new Nuget uses project.json file instead of the old project.config so I started with adding this new file to all projects. Then I moved packages from the old files to the new ones. In the next step I reloaded all the projects just to be sure that VS will see changes. After that I built the solution to see if it works and it worked. Finally, I made a commit and pushed my changes. And here comes a problem. In a few minutes I got an e-mail from my Azure (hosted) build controller that a build has just failed.

§ Error: C:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.24\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1
§ Packages failed to install

The source of a problem was apparently a conflict between project.config and project.json so I just removed the former from the projects.

Naming problem

It is not everything. The next problem looked in the following way:

Failed to resolve conflicts for .NETFramework,Version=v4.6 (win).
Unable to satisfy conflicting requests for 'MVVMLight': project/MVVMLight (>= 1.0.0) (via project/MVVMLight 1.0.0)
Unable to satisfy conflicting requests for 'CommonServiceLocator': CommonServiceLocator (>= 1.3.0) (via project/MVVMLight 1.0.0)
Unable to satisfy conflicting requests for 'MvvmLight': MvvmLight (>= 5.1.1) (via project/MVVMLight 1.0.0)...

This time the fix was also easy. Nuget V3 doesn't like if the projects in the solution have exactly the same names as packages! In my solution I had MVVMLight project which is my playground for MVVMLight package. I renamed in to MVVMLightTest.

Last but not the least

After migration to Nuget V3 I had to deal with one more problem and again I didn't observe it locally but only when building on Azure (hosted) build controller. In the build log I found the following error:

The OutputPath property is not set for project 'LanguageTrainer.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='x86'.

And it turned out that in some csproj files I had the following condition:

<Platform Condition=" '$(Platform)' == '' ">x86</Platform>

It says that if the platform is not specified for a given build then use x86. At the same time these csproj didn't contain configuration, including the problematic OutputPath, for x86. To fix a problem I simply changed x86 to AnyCPU.

23/12/2016

Życzenia Świąteczne / Merry Christmas 2016

Home


Source: own resources, Authors: Agnieszka and Michał Komorowscy

Kolejny rok minął jak z bicza strzelił. Dużo się w nim działo, a w 2016 przynajmniej u mnie będzie się działo jeszcze więcej i z pewnością będzie ciekawie. Zanim to jednak nastąpi czekają nas Święta Bożego Narodzenia, czas odpoczynku, spotkań w rodzinnym gronie... i z tej okazji życzę Wam i Waszym bliskim wszystkiego dobrego.

Wszystkiego dobrego,
Michał Komorowski

*************************************************************************

Another year passed like a whip shot. Much has happened in 2015 but even more is going to happen in 2016, at least in my case;) But it is still the future and now Christmas is right around the corner. It is a time of rest, meetings with the family... and on this occasion I wish You and Your relatives all the best.

Best wishes,
Michał Komorowski

19/12/2016

Murphy's law in practice

Home

The photo comes from MSI website

You must have heard about Murphy's law saying that Anything that can go wrong, will go wrong. We can also add ...at the least expected moment or ...at the worst possible time. Some time ago I had quite a busy evening i.e. I had to write some urgent e-mails etc. Everything was ok until suddenly my computer (MSI GE60 2OE, Windows 10) went crazy.

12/12/2016

Did you know that about HTTP?

Home


Titile: Chapel of the Emerald Buddha in Bangkok, Source: own resources, Authors: Agnieszka and Michał Komorowscy

Recently, when answering a question on stackoverflow.com, I've learned an interesting thing about HTTP protocol. Actually currently it seems to be obvious to me ;) What I'm talking about? Well, initially I thought that if you send GET HTTP request in order to download a specific URL, then in a response you will get an entire page/file. In other words I thought that it's not possible to read the specific part of a page/file. However, it turned out that it's quite easy.

05/12/2016

You will love it

Home


A screenshot comes from ShareLaTeX web site

Sometime ago I wrote that I was amazed when I found out that Nuget supports C++. Today, I was amazed even more, when I discovered ShareLaTeX web site. This site is simply great and I don't know how I've been living without it for such a long time.

28/11/2016

Nuget in C++ rulez

Home


Source: own resources, Authors: Agnieszka and Michał Komorowscy

I haven't been programming in C++ for a very long time and I didn't expect that I would do it professionally in the foreseeable future. However, the life has different plans ;) Recently, I've joined an extremely interesting project in the area of the computer vision. In a while I'll try to write something about it.

22/11/2016

How to validate dynamic UI with JQuery?

Home


Source: own resources, Authors: Agnieszka and Michał Komorowscy

One of the most interesting task I developed some time ago was a library responsible for the generation of dynamic UI based on XML description in ASP.NET MVC application. The task was not trivial. The UI had to change based on the selections made by a user. I had to support many different types of controls, relations between them e.g. if we select the checkbox A then the text box B should be disabled and of course validations. In order to perform the client side validations I used jQuery Unobtrusive Validation library. I thought that it'll work just like that but it turned out that a dynamic UI may cause problems. Here is what I did.

16/11/2016

3 reasons why I don't use strict mocks

Home


Source: own resources, Authors: Agnieszka and Michał Komorowscy

The majority, if not all, of mocking frameworks provides 2 types of mocks i.e. strict & loose. The difference between them is that the strict mocks will throw an exception if an unexpected (not configured /set up) method was called. I prefer to use loose mocks because with strict ones unit tests are fragile. Even the small change in the code can cause that unit tests will start failing. Secondly, if you need to set up many methods a test becomes less readable. Now, I can see one more reason.

31/10/2016

Roslyn - How to create a custom debuggable scripting language 2?

Home


A screenshot comes from Visual Studio 2015

In the previous post I explained how to create a simple debuggable scripting language based on Roslyn compiler as a service. By debuggable I mean that it can be debugged in Visual Studio as any "normal" program for example written in C#.

27/10/2016

Roslyn - How to create a custom debuggable scripting language?

Home


A screenshot comes from Visual Studio 2015

Sometime ago I decided to play a little bit with Cakebuild. It's a build automation tool/system that allows you to write build scripts using C# domain specific language. What's more it is possible to debug these scripts in Visual Studio. It is interesting because Cake scripts are neither "normal" C# files nor are added to projects (csproj). I was curious how it was achieved and it is result of my analysis. I'll tell you how to create a simple debuggable scripting language. By debuggable I mean that it'll be possible to debug scripts in our language in Visual Studio almost as any "normal" program in C#. Cakebuild uses Roslyn i.e. a compiler as a service from Microsft and we'll do the same.

24/10/2016

.NET Developer Days 2016 - Grand finale

Home


The time has come to summary .NET Developer Days 2016. I think that each conference can be judged based on 3 main factors: organisation, presentations, networking so I'll write a few words about each of these topics.

18/10/2016

Do not forget about GO

Home


Source: own resources, Authors: Agnieszka and Michał Komorowscy

Almost 4 years ago, I wrote a short post in Polish about problems that may occur if we forget about GO keyword in our scripts. I decided to write this post again, this time in English, because recently I helped to fixed exactly the same problem again. As a remainder, GO keyword instructs tools like SQL Management Studio, sqlcmd... to send the batch of T-SQL code to the server. Now, let's look at the following code that creates a stored procedure and tell me what is wrong here:
CREATE PROCEDURE dbo.pr_Fun
AS
BEGIN
    /*...*/
    RETURN
END

GRANT EXECUTE ON dbo.pr_Fun TO public
GO