Skip to main content

Posts

Adding Ctrl-Click “Go To Definition” support to Visual Studio 2015

So here's how I fixed this. First download Noah Richard's extension from:  https://visualstudiogallery.msdn.microsoft.com/4b286b9c-4dd5-416b-b143-e31d36dc622b Save the .vsix file somewhere on your computer Open the file with Winzip / Winrar or similar (it's just a disguised .zip file so you could change the extension to .zip) Open the extension.vsixmanifest file in a text editor Add the following lines inside the  <SupportedProducts>...</SupportedProducts>  section: <VisualStudio Version="14.0"> <Edition>Pro</Edition> </VisualStudio> Update the zip file with the modified file and change it back to a .vsix file. Double click the .vsix and install. Ref :  https://stackoverflow.com/questions/33301909/adding-ctrl-click-go-to-definition-support-to-visual-studio-2015 Visit -  https://marketplace.visualstudio.com/items?itemName=NoahRichards.GoToDefinition https://marketplace.visualstudio.com/items?ite...

How to increase timeout for your ASP.NET Application ?

A. executionTimeout attribute of httpRuntime element (web.config): ASP.NET will timeout the request, if it is not completed within “ executionTimeout ” duration value. And System.Web.HttpException: Request timed out exception will be thrown by ASP.NET Application. executionTimeout attribute of httpRuntime element (in the web.config) can be used to change the request timeout duration for ASP.NET Application. executionTimeout   value is specified in seconds. Default value is 110 seconds. <configuration> <system.web> <httpRuntime targetFramework= "4.5.1" executionTimeout= "500" /> </system.web> </configuration> B. timeout attribute of sessionState element (web.config): If the user remains idle for duration specified in  timeout attribute vaule of sessionState element (in web.config) , then his session will expire. timeout attribute of sessionState element (in the web.config) can be used to change session tim...

Override AccessTokenExpireTimeSpan - Session Expire too early

You have to set the expiration time in the  TokenEndPoint  method instead of  GrantResourceOwnerCredentials  method: public override Task TokenEndpoint(OAuthTokenEndpointContext context) { ... if (condition) { context.Properties.ExpiresUtc = DateTime.UtcNow.AddDays(14); } ... } Ref:  https://stackoverflow.com/questions/32120754/override-accesstokenexpiretimespan

SQL Server replace, remove all after certain character

Use LEFT combined with CHARINDEX: UPDATE MyTable SET MyText = LEFT ( MyText , CHARINDEX ( ';' , MyText ) - 1 ) WHERE CHARINDEX ( ';' , MyText ) > 0 Note that the WHERE clause skips updating rows in which there is no semicolon. Here is some code to verify the SQL above works: declare @ MyTable table ([ id ] int primary key clustered , MyText varchar ( 100 )) insert into @ MyTable ([ id ], MyText ) select 1 , 'some text; some more text' union all select 2 , 'text again; even more text' union all select 3 , 'text without a semicolon' union all select 4 , null -- test NULLs union all select 5 , '' -- test empty string union all select 6 , 'test 3 semicolons; second part; third part;' union all select 7 , ';' -- test semicolon by itself UPDATE @ MyTable SET MyText = LEFT ( MyText , CHARINDEX ( ';' , MyText ) - 1 ) WHERE CHARINDEX ( '...

How to set up git server on local network (Windows tutorial)

It is just easy as 1, 2, 3: 1) Go to folder, where you want to initialize server. Give it a name without spaces (or you will need to use quotes everywhere later to access this folder!) 2) Open git bash in this folder 3) Type git init yourpreferredname.git --bare (Note: you can try to name your folder without ‘.git’ at the end but in some cases it led to troubles later) Congrats! You’ve just set up your server! Let’s find out how to connect to it 4) Choose where you want to initialize client repository and open git bash there. Type: git clone <path_to_your_server> IMPORTANT! DO NOT FORGET TO CHANGE BACKSLASH (‘\’) IN THE PATH TO DIRECT SLASH(‘/’) Congrats! You can use this repository as usual and open it with your favorite git client. Ok, but how to connect to this server from another computer in local network? Easy! 5) Firstly go to Control Panel > Network And Sharing Center > Change advanced sharing settings Tick turn on network ...