Resolved: An unexpected error with a provider-hosted app for SharePoint

Scenario: You developed and hosted an ASP.NET  MVC site on IIS and planning to consume this provider-hosted app in SharePoint. When accessing standalone, the MVC site is working fine but when installing and called from SharePoint, it throws an error “An unexpected error has occurred. Please try again by launching the app installed on your

Installing assembly in GAC in Windows Server 2008 : Resolved

I developed an event handler and need to deploy it on production server. My production server is built on Windows 2008 Enterprise Server 64 Bit and there was only one installation on server i.e. SharePoint Server 2010. Now I need to install my assembly in to GAC. I copied my .dll to production server. Then

Call Hierarchy : A handy feature in Visual Studio 2010

Suppose we have a solution that contains different dependent projects. We can face 2 most common situation here: Situation 1: We have a method that we need to change by modifying the definition of that method or just we want to check that which other methods are calling this method. Situation 2: We have a

Create large size file for testing on the fly!

Suppose we write some custom code for uploading/downloading files. Now we want to test the size limitation of a file for Uploading/downloading the file. So for achieving this we look a large file here and there in our system for testing. Here i am demonstrating that how to create a large file for testing in

Procedure or Function expects parameter, which was not supplied : Resolved

I created a stored procedure as follows: Create procedure spInsertTable1  @Name varchar(50),  @Phone Varchar(50)  As  Begin   Insert into Table1(Name,Phone) values (@Name,@Phone)  End Now I wanted to insert the values from front end using this stored procedure. To achieving this thing I wrote the below mentioned code. protected void btnSubmit_Click(object sender, EventArgs e)         {            

Resolved: Could not load file or assembly ‘Microsoft.SharePoint.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies…

I have a solution that contains SharePoint dll’s reference. Whenever I run the solution, start page get crash and show me this error. “Could not load file or assembly ‘Microsoft.SharePoint.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” Well every time I run

Resolved: COM DLL is not showing in COM Library after Registering on Windows Server 2008 x64

Well I had to implement a payment gateway at my server. My server was built on x64 architecture and had Windows Server 2008 installed. Well according to the document I had to put my COM dll inside c:\windows\system32 folder and then from Run command I had to register this dll like “regsvr32 c:\windows\system32\MyCOM.dll”. Well I

Get HTML of a web page using C#.NET

Below i am using a function that takes a web page full url as string and return back HTML of that page as string. You can use this returned HTML in your code as per your requirement. Step 1: First import 2 namespaces that are required by this function to work. using System.IO; using System.Net;

Programming Tips for .NET Guys !

1. How to handle single quote (‘) during insertion and updation ? Suppose there is a text box in form and you want to handle single quote ( ‘ ) during insertion and updation. string StrValue=this.TextBox1.Text; StrValue=StrValue.Replace(“‘”,”””); 2. How to handle maximum length in multi line text box ? Suppose there is a multi line text

Static Classes and Static Class Members in Microsoft.NET

Static Classes and Static Class Members    Static classes and class members are used to create data and functions that can be accessed without creating an instance of the class. The data and functions do not change regardless of what happens to the object. Static Classes A class can be declared static, indicating that it