.NET battlefield - Page 2 of 15 - bits and pieces of code

Update Node.js integrated with Visual Studio 2015

Visual Studio 2015 comes with several useful third-party tools installed and integrated with IDE. Those include Node.js, npm, git client, etc. Task Runner Explore window, that was a separate extension in VS2013, is now part of the default installation and allows to run task defined for Gulp or Grunt.

What I have noticed stumbling into a problem recently, is that those tools (so far) didn’t get any updates – there’s nothing in Extensions and Updates, Windows Update or Notifications panel in Visual Studio related to those tools that would suggest that update is needed. Still, the world goes on. Node.js has recently released it’s 4.0.0 version (a big jump in numeration from 0.12.7 released before), but the image I currently have in \Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\node\node.exe is at version 0.10.31, so this executable is currently over 1 year old.




Generate JSON Schema from C# class

This text demonstrates how to generate JSON Schema for a given C# class. If you like strong-typed languages like C#, then you will probably love JSON Schema, as it allows to describe JSON structure in terms of data types, maximum length of strings, regex patterns for field validation etc. If you use Visual Studio 2013 Update 4 or newer, then you will also have full IntelliSense support for this standard, which makes writing JavaScript code much less error-prone and more fun.



Is SPFieldLink missing ShowInEditForm and ShowInNewForm properties?

Are some properties missing from SPFieldLink?

When you try to construct data relationship structure in SharePoint, at some point you might notice that SPFieldLink is missing the two boolean flags known from SPField type: ShowInEditForm and ShowInNewForm. To make it more confusing, the ShowInDisplayForm flag is available and exposed as a public property.

A fragment of MSDN documentation for SPFieldLnk

Fig. 1. A fragment of MSDN documentation for SPFieldLnk

Should the missing properties be available? That’s clearly what developers expect. Moreover, MSDN documentation displays those properties in example on the SPFieldLink.SchemaXML documentation page. Also, SPField object contains private fields for ShowInEditForm and ShowInNewForm. Is it just a mistake that those fields weren’t exposed as public properties, or the functionality is just not implemented in SharePoint 2013?




SharePoint: integer field doesn’t appear in site columns

This article presents a little SharePoint weirdness that you might encounter when you try to add the column of the SPFieldType Integer to the site columns collection.

The following line seems perfectly fine in Visual Studio, the code compiles and throws no exception at runtime: