Command line to install cab-packed MSHelp3 help package into Microsoft Help Viewer in VS 2017

I have a help package for one of our .NET products in the .mshc format and need to automate its integration into VS’s Microsoft Help Viewer during the product installation process. To do this, I packed the .mshc file into a .cab archive using the Windows makecab.exe utility and signed the .cab file with a valid Comodo digital certificate.

When I tried to install this .cab file with the HlpCtntMgr.exe utility using the following command line

"C:\Program Files (x86)\Microsoft Help Viewer\v2.3\HlpCtntMgr.exe" /operation install /catalogname VisualStudio15 /locale en-us /sourceuri

, I got an error telling me that “the /sourceUri argument specifies an invalid location”.

Well, I tried to integrate my file manually in the Microsoft Help Viewer, but it turned out that files of the .cab format cannot be added – only .mshc files.

Is there a way to install MSHelp3 help files in .cab archives from command line? For me, it looks like this feature is no longer supported – at least, in the latest release of Microsoft Help Viewer v2.3 supplied with VS 2017.

P.S. I also tried to upload my file to a corporate web-server and specify its sourceUri using the HTTP protocol, but this also failed. If anybody knows how to automate installing of help cabs from the Internet – let me know in comments.

Getting website image generated by javascript (basically is a captcha)

I want to get this captcha into a picturebox, in vb.
The objective is to access a website and send the captcha image to the program, in order for the user to write the captcha text in a TextField and access the site contents.

Is it possible?? XD
the code i already have is bellow (its working but it does not get the captcha image πŸ™ )
thx everyone i appreciate all the help

Private Sub txtFileURL_TextChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtFileURL.KeyDown

    If e.KeyCode = Keys.Enter Then
        Dim fileURL As String = txtFileURL.Text
        Dim fileName As String = My.Computer.FileSystem.GetName(fileURL)

        Dim saveFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
        Dim saveFullPath As String = saveFolder + "\" + fileName

            My.Computer.Network.DownloadFile(fileURL, saveFullPath)
            MsgBox("Saved in Desktop!")
        Catch ex As Exception
            Dim file As System.IO.StreamWriter
            file = My.Computer.FileSystem.OpenTextFileWriter("D:\test.txt", True)
    End Try
    End If

End Sub

Visual studio 2013 – designer file properties keeps reverting to default [on hold]

I have a DataGridView and the CellDefaultStyle is continually being reset to bold. I checked it in 3 times to git and it’s being reset to default contiunally – not sure what the mechanism is. Would moving the DGV do that? Has anyone experienced anything like this?

Add multiple fields to webform on ASP.Net with just one button click

I have a webform in ASP.Net (Visual Studio). I have two buttons on the form, one button (button 1) submits the form and another button (button 2) would be used to add additional fields to the forms. I want to be able to click Button 2 to add all of the fields (clock, operator, OrderNo, PartNo and Machine) that are currently on the form with just one click. The user should also be able to add up to 20 such sets of additional fields. Please note that Machine field uses a dropdown list. Any kind of help would be appreciated. Thanks!

 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication3.WebForm1" %>

<!DOCTYPE html>

<html xmlns="">
 <head runat="server">
<style type="text/css">
    .auto-style1 {
        font-size: xx-large;
        text-align: center;
        height: 40px;
    .auto-style2 {
        width: 100%;
        height: 610px;
        margin-bottom: 8px;
    .auto-style3 {
        width: 278px;
        text-align: center;
    .auto-style4 {
        width: 278px;
        height: 23px;
        text-align: center;
    .auto-style5 {
        height: 23px;
    .auto-style7 {
        width: 278px;
        text-align: center;
        height: 47px;
    .auto-style8 {
        height: 47px;
    .auto-style9 {
        text-align: center;
<body style="height: 320px">
<form id="form1" runat="server">
        <h3 class="auto-style1">Checksheet</h3>
        <table align="center" class="auto-style2">
                <td class="auto-style3">
                    <asp:TextBox ID="txtclock" runat="server" TextMode="Number" Width="500px" Required="required"></asp:TextBox>
                <td class="auto-style3">
                    <asp:TextBox ID="txtoperator" runat="server" Width="500px" Required="required"></asp:TextBox>
                <td class="auto-style3">
                    <asp:TextBox ID="txtorderno" runat="server" TextMode="Number" Width="500px" Required="required"></asp:TextBox>
                <td class="auto-style3">
         <asp:TextBox ID="txtpartno" runat="server" Width="500px" Required="required"></asp:TextBox>
       <asp:DropDownList ID="txtMachine" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" Width="500px" AppendDataBoundItems="True" Required="required">

This is the code behind the webform.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data.SqlClient;
    using System.Configuration;

   namespace WebApplication3
public partial class WebForm1 : System.Web.UI.Page

    protected void Page_Load(object sender, EventArgs e)


    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)


    protected void Button1_Click(object sender, EventArgs e)



    protected void Button2_Click(object sender, EventArgs e)


How to make Directory.Build.props and Directory.Build.targets work with Visual Studio 2015 (MSBuild 14.0)

With Visual Studio 2017 and MSBuild 15.0 a new feature was introduced to extend the build process for all projects in a solution at a central place by placing a Directory.Build.props and/or Directory.Build.targets file in the root folder of the solution (the folder in which the *sln file resides).

Unfortunately, this great feature does not work with older VS and MSBuild versions. But there is a simple solution (among others) to make VS 2015 use these files in the same way as VS 2017 does.

After studying how MSBuild works I figured out that there is Microsoft.Common.targets file located in the MSBuildToolsPath (e.g. C:\Program Files (x86)\MSBuild\14.0\Bin) which is used during each build.

When I compared the Microsoft.Common.targets files of MSBuild 14.0 and MSBuild 15.0, it turned out that they are almost identical. The main difference was, that the 15.0 file contains some logic to discover the path of the Directory.Build.targets file and if such a file exists the build targets in this file are also included in the build.

Thus, the solution for me was simply to paste the part that includes the Directory.Build.targets file from the MSBuild 15.0 Microsoft.Common.targets file into the MSBuild 14.0 Microsoft.Common.targets file.

To automate this process and to repeat it on other development machines I made this Windows batch file which discovers the MSBuildTools path and replaces the Microsoft.Common.targets file with the updated one. The updated file I use in this batch script is named MSBuil15.Microsoft.Common.targets and has to be located in the same folder like the batch file. This batch file is based on MSBuildPath.bat and GotAdmin.bat where I added my 2 cents.

@echo off

reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath > nul 2>&1
if ERRORLEVEL 1 goto MissingMSBuildRegistry

for /f "skip=2 tokens=2,*" %%A in ('reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath') do SET "MSBUILDDIR=%%B"

echo MSBuildToolsPath: %MSBUILDDIR%

IF NOT EXIST "%MSBUILDDIR%" goto MissingMSBuildToolsPath
IF NOT EXIST "%MSBUILDDIR%msbuild.exe" goto MissingMSBuildExe
IF EXIST "%MSBUILDDIR%Microsoft.Common.targets.bak" goto AlreadyPatched

REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

    exit /B

    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"

:: Replace MSBuild 14.0 Microsoft.Common.targets file with MSBuild 15.0 file.
rename "%MSBUILDDIR%Microsoft.Common.targets" "Microsoft.Common.targets.bak"
copy "MSBuil15.Microsoft.Common.targets" "%MSBUILDDIR%Microsoft.Common.targets"

exit /b 0

echo Cannot obtain path to MSBuild tools from registry
echo The MSBuild tools path from the registry '%MSBUILDDIR%' does not exist
echo The MSBuild executable could not be found at '%MSBUILDDIR%'
echo The Microsoft.Common.targets file is already patched

why this snipped code triggers breakpoint at second iteration at this line β€œ*(str_arr + i) = (char*)calloc((strlen(temp_str) + 1), sizeof(char));”

Just trying to scan N strings to an array and dynamically allocate them

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N 3
#define MAX_STR_LEN 20

void main(void) {
    char* str_arr[N] = { '\0' };
    char temp_str[MAX_STR_LEN] = { '\0' };

    for (size_t i = 0; i < N; i++)
        //scan string
        fgets(temp_str, MAX_STR_LEN, stdin);
        strtok(temp_str, "\n");

        // next line of code triggers breakpoint at second iteration
        *(str_arr + i) = (char*)calloc((strlen(temp_str) + 1), sizeof(char));
        if (!(str_arr + i))
            printf("Could not allocate memory\n");
            return 1;
        //copy temporary string to dedicated string
        strcpy_s(*(str_arr + i), sizeof(temp_str), temp_str);


Should Visual Studio be building every time Webpack Hot Module Replacement updates

I don’t really know what else to say. I have HMR configured in my start up class like this:

app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
   HotModuleReplacement = true

I confess to not knowing anything really about HMR but I’ve sat here staring at the network tab and VS side by side and whenever a request for __wepack_hmr is made my VS project builds. Really I just want to know if this is the normal behaviour? My brief google turned up nothing

How to Print all source code in visual studio?

I was wondering how to print all of my source code within my solution/project for a code review in visual studio.
I have created a C# application with a database and was wondering if there was anyway to print the C# source code in one go without printing each one individually.

I have tried using the VS code Print extension, however, it will not export the document to a pdf or document to print without paying for it and it also leaves a huge watermark on it too.

Thanks in advance.