Visual Studio Project/Item Template Parameter Logic

This post is linked from the official Microsoft documentation for MSBuild Conditions as having examples of usage. The syntax for MSBuild conditions is not exactly equivalent to the way templating $if$ statements work but it’s a close approximation. However, it seems the examples here are now obsolete or were never completely accurate to begin with. …

Read more

Rendering constants into XML documentation?

Add a summary to each constant containing the value, then refer to those comments: /// <summary>24</summary> private const byte _minAge = 24; /// <summary>29</summary> private const byte _maxAge = 29; /// <summary>Checks whether the age is within the allowed range (between <inheritdoc cref=”_minAge”/> and <inheritdoc cref=”_maxAge”/>).</summary> public bool IsInAgeRange() { … } I know it’s …

Read more

What is the new GlobalSection in a VS2017 15.3 solution file?

According to Mastering Visual Studio book the ExtensibilityGlobals (and ExtensibilityAddIns) section included for the benefit of add-in authors. ExtensibilityGlobals used to store global information about the solution. So it is clearly generated by(or for) some 3rd party tools. The only discussion about SolutionGuid is here, which is generated by CMake and they advise that you …

Read more

save data from visual studio memory window

user142207 has done a great job investigating VS internals, I recommend that solution. I have another way that was invented by my colleague, Sergey S., which is very useful: Windows: Use a couple of functions ReadProcessMemory/WriteProcessMemory. It needs a standalone app that calls these functions with a target process id like: dumper.exe <debugged process id> …

Read more

What is “pch.h” and why is it needed to be included as the first header file?

pch stands for precompiled header. In computer programming, a precompiled header is a (C or C++) header file that is compiled into an intermediate form that is faster to process for the compiler. Usage of precompiled headers may significantly reduce compilation time, especially when applied to large header files, header files that include many other …

Read more

Setting MIME types using the ASP.NET Development Server

The built-in development web server in Visual Studio (Cassini) has no knowledge of <system.webServer>, only IIS7.x or IIS7.5 Express will consume these settings. Also the static file content types in Visual Studio’s development web server are hard coded. From Microsoft.VisualStudio.WebHost.Connection (disassembled using .NET Reflector): private static string MakeContentTypeHeader(string fileName) { string str = null; FileInfo …

Read more