My Blog

Here you can find my private notes about programming that I wanted to share with you. Feel free to filter based on the topic you want or search for something specific.

    JavaScript IntelliSense in Visual Studio 2015 and 2017 - The current stand, as of 2018

    If you are writing vanilla JavaScript in a large web application, it is almost certain that you are dealing with multiple JavaScript files which are scattered in multiple Visual Studio projects, stored in different solutions. Visual Studio does not provide any IntelliSense features for referenced code which sits outside of the current project.

    One solution to this problem is to manually search for the specific file and find out which arguments does your function need or which functions are contained in a JavaScript object. Since this can be a tedious action, Visual Studio gives us the option to activate IntelliSense in our JavaScript files by creating a file named _references.js. TypeScript users are already experiencing the benefits of code completion by using the d.ts definition files.

    The use of _references.js is not a new feature. It exists for many years now, however, with this article I want to give you the current stand of the feature, as of 2018. I want to find out if the file still does what is supposed in Visual Studio 2015 and 2017.

    Read the complete article

    How to pass and read query parameters from one page of your application to another by using the React Router

    In this post we are going to see how you can register a new route in your React application and then pass information with the help of query parameters from one subpage to another.

    Let us suppose the following scenario. You have page that contains a list of products with some basic information. You want to be able to click on an item of this list and navigate to a details-page, where the user can find more details about a specific product.

    The following code examples are written in TypeScript. Visual Studio provides a great starting template for your React projects. I used the 4th generation of the React Router

    First we need two routes for the scenario we just mentioned. The first route loads all the products, with only a limited information for each of them, from our backend and the second one loads the all the details to one product:

    Read the complete article

    The reason behind the identifier could not be resolved error in your CosmosDB queries

    When writing SQL queries to test them against your CosmosDB collections, chances are that your deal with the following error message:

    Identifier XXX could not be resolved.

    where XXX is the name of a property inside your collection. You could have for example the following query:

    SELECT * FROM students WHERE firstname = 'Christos'

    The reason for the error is that you forgot something in your query.

    Read the complete article

    Manage configuration in your .NET Core web projects by using the IOptions interface

    Every application out there needs to read some configuration written from the programmers in order to perform critical tasks and function correctly. Examples of configuration can be the connection string to your SQL database or a boolean flag which decides if a feature will be available to your customers or not.

    .NET Core gives us a way to store our configuration in a json file and access its properties programmatically.

    This way of coding gives us the advantage of not having to redeploy our application, every time we update a value in our configuration (in our case the json file). We simply have to recycle the application pool that hosts our application and we are set.

    Read the complete article

    How to solve the "project.assets.json not found. Run a NuGet package restore to generate this file" problem in .NET Core applications when using MSBuild

    While I was developing a .NET Core web application and wanted to automate the build process in VSTS, I got the following error, when I was triggering the build:

    Error: Assets file ...\project.assets.json not found. Run a NuGet package restore to generate this file. Process 'msbuild.exe' exited with code 1.

    The issue here is that needed .NET Core files are missing, when we start build our application. I solved this problem by defined an extra initial step in my build process.

    Read the complete article