Visual Studio Task List Feature

Visual Studio has a handy feature, Task List. Click on View->Task List.

Task list has tokens that are used to track code comments. This also acts as a shortcut to navigate to relevant code section. This list comes with 3 default tokens; TODO, HACK and !UnresolvedMergeConflict.

We can add custom tokens, if we want. Here is how;

Open Tools -> options -> Environment, you will see Task List.

Add a new custom token;

To make this feature working, All you need to do is to add comments in your code;

    /*
        HACK: I don't need serviceProviderId parameter here. The only reason I am adding this becuase this comes
        from a link in razor page list and I need to keep serviceProviderId and projectId in session. 
        Session starts here for now.
     */
    [HttpGet]
    [Route("ProjectTask/ProjectTaskList/{projectId:Guid}")]
    public async Task<IActionResult> ProjectTaskList(Guid projectId)
    {
        var result = await _httpFactoryService.GetProjectActionAsync(projectId);
        return View(result);
    }

Reference

Using the Task List

Working with packages and libraries in .NET Core

If you want to develop a modern web application, you will realize very quickly that you can’t write everything on your own. You will rely on some third party client and server side libraries and components to increase your development speed. There are many online code repositories and sources available to developers these days and downloading and keeping track of all third-party packages can be a painful task

Read more here.

SSDT Installation

Recent changes in Visual studio installer is breaking SSDT installation with this error;

We need to do an offline installation as outlined here;

https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017#ssdt-for-vs-2017-standalone-installer&WT.mc_id=DP-MVP-5003166

Download SSDT from here;

https://go.microsoft.com/fwlink/?linkid=2169967&WT.mc_id=DP-MVP-5003166

Download vs_sql.exe file from here;

https://aka.ms/vs/15/release/vs_sql.exe

Open DOS prompt as administrator and navigate to downloaded files
MS DOS
vs_sql.exe –layout C:\Business\Trash\SSDT\OfflineFiles –lang en-us

If there is error in download, type the command below to fix the error: (only do this if you also had download errors) ;

vs_SQL.exe –layout C:\SSDT2017 –fix

Navigate to the directory where you downloaded the layout files (in my case, C:\Business\Trash\SSDT\OfflineFiles)
vs_setup.exe –NoWeb

There’s not much to change here, just click on the Install button (or maybe change the installation path):

Once installation is done, we will be able to see a minimal version of VS2017.
Now we can install SQL Server Data Tools 2017 (SSDT) ​​through the normal installer (SSDT-Setup-ENU.exe), remembering to check the SSIS, SSRS and SSAS options:
SSDT-Setup-ENU

Once the installatin is successful, make sure the SQL Server project templates (Database Project / SQLCLR), Analysis Services (SSAS), Integration Services (SSIS) and Reporting Services (SSRS) are working normally.

You are done.

Update for VS2022

Microsoft added a public preview of the SQL Server Integration Services Projects 2022 to the Visual Studio marketplace, which is tested against Visual Studio 2022 17.4

You can read full discussion on stack overflow.

Reference

https://en.dirceuresende.com/blog/como-corrigir-erro-na-instalacao-do-sql-server-data-tools-ssdt-2017-setup-failed-incorrect-function-0x80070001/

Stop tracking the files that should be ignored in Git

To stop tracking the files in the ignore file open a command prompt or terminal window from your Visual Studio and navigate to the directory that contains your solution file (.sln) and run the following commands.

git rm -r --cached . 
git add .
git commit -am "Remove ignored files"

That seemed to do the trick for me. The git commands I found here. If you click on that link you will see there are lots of options on which commands to use for this process. If the above doesn’t work for you one of the other answers should meet your needs.

How to add gitignore file existing solution using Visual Studio

Standard Practice to Create Repository

ASP.NET Web Site or ASP.NET Web Application?

Website:

The Web Site project is compiled on the fly. You end up with a lot more DLL files, which can be a pain. It also gives problems when you have pages or controls in one directory that need to reference pages and controls in another directory since the other directory may not be compiled into the code yet. Another problem can be in publishing.

If Visual Studio isn’t told to re-use the same names constantly, it will come up with new names for the DLL files generated by pages all the time. That can lead to having several close copies of DLL files containing the same class name, which will generate plenty of errors. The Web Site project was introduced with Visual Studio 2005, but it has turned out not to be popular.

Web Application:

The Web Application Project was created as an add-in and now exists as part of SP 1 for Visual Studio 2005. The main differences are the Web Application Project was designed to work similarly to the Web projects that shipped with Visual Studio 2003. It will compile the application into a single DLL file at build time. To update the project, it must be recompiled and the DLL file published for changes to occur.

Another nice feature of the Web Application project is it’s much easier to exclude files from the project view. In the Web Site project, each file that you exclude is renamed with an excluded keyword in the filename. In the Web Application Project, the project just keeps track of which files to include/exclude from the project view without renaming them, making things much tidier.

Reference

The article ASP.NET 2.0 – Web Site vs Web Application project also gives reasons on why to use one and not the other. Here is an excerpt of it:

  • You need to migrate large Visual Studio .NET 2003 applications to VS 2005? use the Web Application project.
  • You want to open and edit any directory as a Web project without creating a project file? use Web Site project.
  • You need to add pre-build and post-build steps during compilation? use Web Application project.
  • You need to build a Web application using multiple Web projects? use the Web Application project.
  • You want to generate one assembly for each page? use the Web Site project.
  • You prefer dynamic compilation and working on pages without building entire site on each page view? use Web Site project.
  • You prefer single-page code model to code-behind model? use Web Site project.

Web Application Projects versus Web Site Projects (MSDN) explains the differences between the web site and web application projects. Also, it discusses the configuration to be made in Visual Studio.

Reference

https://stackoverflow.com/questions/398037/asp-net-web-site-or-asp-net-web-application