Error TS2415 Class ‘Subject’ incorrectly extends base class ‘Observable’.

After you setup angularjs 2 in your visual studio 2015, if you get this error:


Severity Code Description Project File Line Suppression StateSeverity Code Description Project File Line Suppression StateError TS2415 Class ‘Subject<T>’ incorrectly extends base class ‘Observable<T>’.  Types of property ‘lift’ are incompatible.    Type ‘<R>(operator: Operator<T, R>) => Observable<T>’ is not assignable to type ‘<R>(operator: Operator<T, R>) => Observable<R>’.      Type ‘Observable<T>’ is not assignable to type ‘Observable<R>’.        Type ‘T’ is not assignable to type ‘R’. TypeScript Virtual Projects C:\Users\xxxxxxx\Documents\Visual Studio 2015\Projects\Angular2Demo\Angular2Demo\node_modules\rxjs\Subject.d.ts 16 Active


All you have to do is:

Open this file:


and add the following line:


“noStrictGenericChecks”: true,


inside  “compilerOptions”: {


the entire file should look like:


“compilerOptions”: {
“noStrictGenericChecks”: true,
“target”: “es5”,
“module”: “commonjs”,
“moduleResolution”: “node”,
“sourceMap”: true,
“emitDecoratorMetadata”: true,
“experimentalDecorators”: true,
“lib”: [ “es2015”, “dom” ],
“noImplicitAny”: true,
“suppressImplicitAnyIndexErrors”: true


VS2013 An exception occurred while initializing the database

I’m doing a code first Entity database

{“An exception occurred while initializing the database. See the InnerException for details.”}

It was working fine, but I decided to delete the physical database to see it recreate it, but it just fails every time.

I get the error

Cannot attach the file ‘C:\ASP\OdeToFood\OdeToFood\App_Data\OdeToFoodDb.mdf’ as database ‘OdeToFoodDb’.”}

Its code first so I don’t understand why its not recreating the database.



So deleting the file from Visual Studio was a dumb idea.

SQL still has it registered.

Fire up MS Sql Management Tool, connect to the server in my case


You will see the database, still exists, delete it, you will get an error. The file doesn’t exist. Refresh and its gone from SQL. Now run your code again and all is good.

So delete the DB from the management tool not visual studio

Perform Specific Button click event when user press Enter key in Textbox

Put your form inside an panel control and set its DefaultButton attribute with your button ID. See the code below:


<asp:Panel ID="Panel1" runat="server" DefaultButton="Button1">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Send" />

VS 2013 : Project name with number in brackets

In file C:\Users\Username\Documents\IISExpress\config\applicationhost.config, under section



there was all websites (projects) I have ever opened. I deleted these items and now, on New Website there is no number in brackets. NOTE: I think it is not wise to delete the entire file but only the part that applies to sites/projects.




Visual Studio 2013 Change the Default Location for Projects

For corporate office user my document is always redirected to a file server where creating exe file is restricted.

1. Create a folder in c drive called: vs 2013

2. Inside that folder create 2 folders



3. Inside Templates, create another 2 folders:



4. Open visual studio and follow the steps

  • On the Tools menu, select Options.
  • From the Projects and Solutions folder, select General.
  • In the Visual Studio projects location text box, enter a location for files and projects.




And you should be all set.


Remove HTML tags in String in C#

If the string is like that

string s = “"<p>hello <b>there</b></p>"


Use the regular expression:


using System.Text.RegularExpressions;

static string StripHTML (string inputString)
   return Regex.Replace 
     (inputString, "<.*?>", string.Empty);

But if the input string is like this:

String s = "&lt;/b.......&gt;"

You need to decode it first using http utils as follows:

Add a sub functiona and pass the input string to that to decode the string and use the regular expression avobe.

public static string DecodeHtmlEntities(string text)
        return HttpUtility.HtmlDecode(text);

RadioButton group example: how to use RadioButton array / group in

<%@ Page Language=”C#” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”&gt;

<script runat=”server”>
protected void RadioButton_CheckedChanged(object sender,System.EventArgs e) {
if (RadioButton1.Checked == true)
Response.Write(“You Selected: Asp.Net”);
else {
Response.Write(“You Selected: ColdFusion”);

<html xmlns=””&gt;
<head runat=”server”>
<title>RadioButton example: how to use RadioButton control in</title>

<form id=”form1″ runat=”server”>
<asp:RadioButton ID=”RadioButton1″ runat=”server” Text=”Asp.Net” GroupName=”Software” AutoPostBack=”true” OnCheckedChanged=”RadioButton_CheckedChanged” />
<asp:RadioButton ID=”RadioButton2″ runat=”server” Text=”ColdFusion” GroupName=”Software” AutoPostBack=”true” OnCheckedChanged=”RadioButton_CheckedChanged” />







By simplemsexchange Posted in ASP.NET