Miscellaneous Errors in Visual Studio

asp-core-visual-studio-errors

Hi there, in this post I want to introduce you to some solutions for errors in Visual Studio. These errors aren’t stemmed from the Visual Studio itself but lack of subtle experience with it. These errors are small but make you sick.

Breakpoint Not Hit, No Symbols Loaded For…

If you have multiple projects under one solution, for debugging the secondary solution please use the multiple startup options. I know it is sometimes a headache to debug class libraries. There is a solution for this.

  • First right-click on the solution
  • Go to properties
  • The open window will show you the startup project, make your debug project startup project with along your main project.

Run Projects (or IIS) in x64 Mode

x64 offers better memory utilization for ASP and ASP Core application. If you are using the RAM heavily, please make it a must to run under x64. How can you achieve this?

  • Go to tools
  • Click on the properties
  • Type 64 in the search bar
  • At the menu in the right, click on use x64 bit of the IIS version.

Stop Debugger when The Browser is Closed

It is irritating of Visual Studio quitting when the browser is closed but again there is a solution for this.

  • Go to tools
  • Click on the properties section
  • Type 64 in the search bar
  • At the menu right, there is an option like “Close the debug session when the browser is closed…”. Uncheck this item.

Gitignore Doesn’t Work

Create a clone repository and rebase your code to your laptop with a ignore file. You can add *.dll or .sln. This way, you won’t check in in every compile.

String Compare Doesn’t Work

I would rather use StringComparer.OrdinalIgnoreCase.Equals(abc.Trim(), abc.Trim()). This way you dodge the compiler’s weird feedbacks. The string has been a hard topic since very early ages, as in the C language. C# is easier although it sometimes gives bizarre errors. I am suspecting normal comparing with == operator, compares the references, not the values.

By the way you can also use an abstraction over strings called StringBuilder. You can always use it.