dotnet / dotnet/project-system

VB: .NET Standard class library project should honour defaults specified in Options window.

Open
#3,040 6 comments 1 reaction 1 assignee Assigned to @melytc View on GitHub
Area-VisualBasic Feature-Legacy-Application-Designer Parity-Legacy-Feature Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

**Version Used**:

Visual Studio Community 2017 v15.4.4

**Current Behavior**:

Create a new .NET Standard 2.0 class library in VB and open the project settings page, you will see the following:

![vs_lib_project_defaults1](https://user-images.githubusercontent.com/20465797/33846020-5fa80074-deb6-11e7-99ce-ce0131c208bb.png)

The various compile options (e.g. `Option Strict`) are actually set as follows on my machine under `Tools > Options > Project and Solutions > VB Defaults` :

![vs_lib_project_defaults2](https://user-images.githubusercontent.com/20465797/33846099-a4de73da-deb6-11e7-81c6-be646e53f110.png)

**Expected Behavior**:

The values for `Option Strict` and `Option Compare` in a newly created .net standard class library should match those in the options window (in my case the options set `Option Strict On` but the library was created with it set to `Off`, and `Option Compare Text` but the library was created with it set to `Binary`).

The discrepancy could lead to very subtle bugs in VB (e.g. `Option Compare` affects case sensitivity of string comparisons) that would be hard to debug unless one knew the project settings were incorrectly initialized relative to the defaults they set in the Options window.

CC: @davkean

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.