How to make html pre tag responsive

If you have a textbox and you want your user to enter multi-text.
it will work fine if you changed your textbox from input to textarea

but there is a small issue how can i present it on desktop and mobile devices.

I'm using MVC in my presentation layer. 

@Html.Raw("<div class='divpre' style='margin-right: -20px;'><pre class='pre'>" + Html.Encode(@Model.Desc) + "</pre><div>")

now the css
1- desktop
.pre
{
  word-break: break-word;
  white-space: pre-wrap;
  text-align: justify;
  overflow-x: hidden;
 }
2- mobile
@media only screen and (max-width: 600px)
.pre
{
  word-break: break-word!important;
  white-space: pre-line;
  overflow: hidden;
}

Visual Studio Cannot access a disposed object. Object name: 'WorkspaceContext' TFS

problem: I have a simple project hosted on our company TFS. our security policy required the development team change there passwords every 1 month.
after changing my password, I recived this error while check In TFS
Cannot access a disposed object. Object name: 'WorkspaceContext'
solution:
You need to visit this location
%LocalAppData%\Microsoft\Team Foundation\7\Cache
inside this location delete the content of this folder and try to connect again to visual studio.

Stop Visual Studio from debugging method or class

Sometimes you need to step through code, So you use debugging in Visual Studio.
But some other times you visit the same method over and over again for 100 times

if and only if the code is tested.
then you can do decorate your method with this attribute  [DebuggerStepThrough()] and your debugger will never hit this method again


List all files in a dirctory and subdirectory contains substring

Open cmd
go to main directory

type the following command.
dir /b /s "PAS*.cs"
this will list all files begin with PAS (uper or lower) case and any set of characters and ends with .cs

visual studio 2017 search and replace regular expressions group

Sometimes you write some codes and then you find your self want to change a suffix or prefix in your codes or classes names or namespaces

I will show with an example how to do it.

 let us supposed we need to change the following "Manager" sub-string into the class name
public interface IParticipantImageManager
in visual studio click on ctrl + shift + H use any website to test your regular expression, personally I use regex101 to write the right expression and the replace it.


to find the string
IParticipantImage(\w+)
and to replace the sting
IParticipantImage$1

Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'

I already posted another post today about solving Visual Studio 2018 Stuck at 'preparing solution'  
If you follow the same solution you will be able to build your solution.

Visual Studio 2018 Stuck at 'preparing solution'

Visual Studio 2018  stuck after lunching specific solution. after spending sometime on the internet,
I found the problem and the fix.

I used Community Edition for visual studio 2018.

1- Close all running instances of Visual Studio 2017
2- Launch the Visual Studio 2017 Developer Command Prompt as Admin
3- Type the following commands (replace Community with your edition, either Enterprise or Professional , or adjust the path accordingly):

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.Framework.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.Engine.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.Conversion.Core.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.Tasks.Core.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.Utilities.Core.dll"

filter attribute that checks whether current connection is secured

using APS.net Core to mark all website pages working with https protocol we will do this using IAuthorizationFilter. and here is an exampl...