Friday, September 22, 2017

The missing file is ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props.

First unload project and then edit .csproj or vbproj file and remove all references having .net compiler version eg. 1.3.2
Edit packages.congig file and remove reference of version Microsoft.net.compiler version 1.3.2
remove same version folder from packages folder
Then go to tool>Nuget package Manager>Package manager console and type following and allow installation

Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -Version 1.0.7

repeat for all errors. It will fix the project issue and then build it.

Saturday, November 21, 2015

Fix loosing session automatically

A number of things can cause session state to mysteriously disappear.

    Your sessionState timeout has expired
    You update your web.config or other file type that causes your AppDomain to recycle
    Your AppPool in IIS recycles
    You update your site with a lot of files, and ASP.NET proactively destroys your AppDomain to recompile and preserve memory.

-

If you are using IIS 7 or 7.5, here are a few things to look for:

    By default, IIS sets AppPools to turn themselves off after a period of inactivity.
    By default, IIS sets AppPools to recycle every 1740 minutes (obviously depending on your root configuration, but that's the default)
    In IIS, check out the "Advanced Settings" of your AppPool. In there is a property called "Idle Time-out". Set that to zero or to a higher number than the default (20).
    In IIS, check the "Recycling" settings of your AppPool. Here you can enable or disable your AppPool from recycling. The 2nd page of the wizard is a way to log to the Event Log each type of AppPool shut down.

Friday, September 25, 2015

To call a webpage or webservice from stored procedure

First of all run following queries with sys admin rights:
sp_configure 'show advanced options', 1
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1
GO
RECONFIGURE;
GO
sp_configure 'show advanced options', 1
GO
RECONFIGURE;

After successful call then run following query:
Declare @Object as Int;
Declare @ResponseText as Varchar(8000);

Exec sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'get',
                 'http://[domain name]/abc.aspx', --Your Web Service Url (invoked)
                 'false'
Exec sp_OAMethod @Object, 'send'
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT

Select @ResponseText

Exec sp_OADestroy @Object