Tag Archives: Visual Studio

Error occurred in deployment step ‘Install app for SharePoint’: The provided App differs from another App with the same version and product ID

SharePoint-2013

Problem:
Cannot deploy a solution and getting the error: Error occurred in deployment step ‘Install app for SharePoint’: The provided App differs from another App with the same version and product ID.

Solution:
Open the AppManifest.xml in code view and generate a new guid for the app -> Change value of ProductID.

This task requires the application to have elevated permissions.

I start my Visual Studio 2010, create new SharePoint project and after giving project name and clicking OK I get this error:

ElevatedPrivVS2010

This task requires the application to have elevated permissions.

I already started VS2010 as administrator, but that’s not the solution yet.

I log to the server via Remote Desktop with my domain account. To be able to connect VS to SharePoint, my account needs to be added to local administrators group (get your admin/domain admin to do that).
Afterwards, I need to log out from Windows (thus ending my session) and log in again. Now, when I run Visual Studio as administrator, I can create new SharePoint project.

Regular Expressions Example (c#) – CSharp

csharp

The following example shows the use of Regular Expresssions in C#.This program has basic validation scripts for validation easily useable in all programs.

/*
<HowToCompile>
csc /r:System.Text.RegularExpressions.dll,System.dll Validation.cs
</HowToComplie>
*/
using System.Text.RegularExpressions;
using System;
class Validation
{
public static void Main()
{
String strToTest;
Validation objValidate=
new Validation();
Console.Write(“Enter a String to Test for Alphabets:”);
strToTest=Console.ReadLine();
if(objValidate.IsAlpha(strToTest))
{
Console.WriteLine(“{0} is Valid Alpha String”,strToTest);
}
else
{
Console.WriteLine(“{0} is not a Valid Alpha String”,strToTest);
}
}
// Function to test for Positive Integers.
public bool IsNaturalNumber(String strNumber)
{
Regex objNotNaturalPattern=
new Regex(“[^0-9]”);
Regex objNaturalPattern=
new Regex(“0*[1-9][0-9]*”);
return !objNotNaturalPattern.IsMatch(strNumber) &&objNaturalPattern.IsMatch strNumber);
}
// Function to test for Positive Integers with zero inclusive
public bool IsWholeNumber(String strNumber)
{
Regex objNotWholePattern=
new Regex(“[^0-9]”);
return !objNotWholePattern.IsMatch(strNumber);
}
// Function to Test for Integers both Positive & Negative
public bool IsInteger(String strNumber)
{
Regex objNotIntPattern=
new Regex(“[^0-9-]”);
Regex objIntPattern=
new Regex(“^-[0-9]+$|^[0-9]+$”);
return !objNotIntPattern.IsMatch(strNumber) &&
objIntPattern.IsMatch(strNumber);
}
// Function to Test for Positive Number both Integer & Real
public bool IsPositiveNumber(String strNumber)
{
Regex objNotPositivePattern=
new Regex(“[^0-9.]”);
Regex objPositivePattern=
new Regex(“^[.][0-9]+$|[0-9]*[.]*[0-9]+$”);
Regex objTwoDotPattern=
new Regex(“[0-9]*[.][0-9]*[.][0-9]*”);
return !objNotPositivePattern.IsMatch(strNumber) &&
objPositivePattern.IsMatch(strNumber) &&!objTwoDotPattern.IsMatch(strNumber);
}
// Function to test whether the string is valid number or not
public bool IsNumber(String strNumber)
{
Regex objNotNumberPattern=
new Regex(“[^0-9.-]”);
Regex objTwoDotPattern=
new Regex(“[0-9]*[.][0-9]*[.][0-9]*”);
Regex objTwoMinusPattern=
new Regex(“[0-9]*[-][0-9]*[-][0-9]*”);
String strValidRealPattern=”^([-]|[.]|[-.]|[0-9])[0-9]*[.]*[0-9]+$”;
String strValidIntegerPattern=”^([-]|[0-9])[0-9]*$”;
Regex objNumberPattern =
new Regex(“(” + strValidRealPattern +”)|(” +
trValidIntegerPattern + “)”);
return !objNotNumberPattern.IsMatch(strNumber) &&!objTwoDotPattern.IsMatch
strNumber) && !objTwoMinusPattern.IsMatch(strNumber) && objNumberPattern.IsMatch(strNumber);
}
// Function To test for Alphabets.
public bool IsAlpha(String strToCheck)
{
Regex objAlphaPattern=
new Regex(“[^a-zA-Z]”);
return !objAlphaPattern.IsMatch(strToCheck);
}
// Function to Check for AlphaNumeric.
public bool IsAlphaNumeric(String strToCheck)
{
Regex objAlphaNumericPattern=
new Regex(“[^a-zA-Z0-9]”);
return !objAlphaNumericPattern.IsMatch(strToCheck);
}
}

There is another simple way to perform these validation think of it while the next article comes.

Installing Visual Studio – Ultimate 2013 with Blend

Visual Studio 2012 - Ultimate 1

To install Visual Studio Ultimate 2013 we are using the following Setup file:

SW_DVD5_VS_Ultimate_2013_English_##_##F_X##-####5

Right Click and Mount, Run “vs_ultimate” Application file as Administrator:

This Screen will Show up:

Visual Studio 2012 - Ultimate 1

Wait for the loading then the following screen will come:

Visual Studio 2012 - Ultimate 2

Note: I have changed the Path so the my Operating Systemdrive (C:\) does not get lot of Load.

Click “I agree” and then Next, then the following screen will come:

Visual Studio 2012 - Ultimate 3 new

Note: We can select what features we need from the above section of “Optional Features to Install”.

Click “Install, then the following screen will come:

Visual Studio 2012 - Ultimate 4 new

After Installation, then the following screen will came:

Visual Studio 2012 - Ultimate Error 5

I did a restart of the Server and AGAIN run the setup of Visual Studio and only one issue remained, the screen was displayed as following :

Visual Studio 2012 - Ultimate Error 7

To resolve issue of Microsoft Web Deploy 3.0 “A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file.”

I googled and found this Microsoft Link, It will download a windows installer file “MicrosoftFixit50531” just run it as Administrator.

Over view of the Error is :

These errors occur because of a failed timestamp comparison in the installer that is caused by an improperly signed Web Deploy Package.If you receive a warning after you successfully complete the installation of Visual Studio 2012, you can fix the problem by installing Web Deploy 3.0.

I did a restart of the Server and AGAIN run the setup of Visual Studio and all issues resolved, the screen was displayed as following :

Visual Studio 2012 - Ultimate 6

Now I clicked “LAUNCH”, following screen came:

Visual Studio 2012 - Ultimate 7 a

Now I clicked “Not now, maybe later”, following screen came:

Visual Studio 2012 - Ultimate 7 b

We have multiple options for “Theme” and “Development Settings”:

Visual Studio 2012 - Ultimate 7 c

Now I clicked “Start Visual Studio”, following screen came:

Visual Studio 2012 - Ultimate 8

It takes some time and we have our Visual Studio Ultimate 2013 “Start Page

Visual Studio 2012 - Ultimate 9

If You look closer to the top right there is a Flag for the “Notification Area”.

Visual Studio 2012 - Ultimate 10

Click “Notification Area” and the following screen appers.

Now you have successfully installed “Visual Studio Ultimate 2013”. Enjoy 😀

Resolving VS 2010 solution deployment issues for SharePoint 2010 projects

In my new SharePoint 2010 book, I touch base on variety of deployment approaches; in this article I wanted to focus on Visual Studio 2010 feature allowing to deploy SharePoint 2010 solutions right to the portal. However, you haven’t configured your development environment properly – you will run into issues. Here I’m talking about the following error:

Error occurred in deployment step ‘Recycle IIS Application Pool’: The local SharePoint server is not available. Check that the server is running and connected to the SharePoint .

Or this:

Error occurred in deployment step ‘Recycle IIS Application Pool’: Cannot connect to the SharePoint site: http://localhost/. Make sure that this is a valid URL the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project

Visual studio uses the following process to deploy your solution: vssphost4.exe
Open your task manager and find the process in the list; take a note of the User Nameunder which this process is running, let’s say it’s myadmin_account

Now, open your SQL Management Studio and ensure this Username is added as a DBOWNER to the following databases:

SharePoint_Config
SharePoint_AdminContent_[guid]
SharePoint Site Content DB

sql-permissions

Close and Open your Visual Studio again, this will ensure the service is recycled; this should fix above deployment error. If you’re still having same issue, End the process in taskmanager and then VS 2010.

Good luck!

Ref : Sharemuch

VS Debug Problem with IE8

I decide to write about a problem that has been opened frequently on ASP.NET official forum which is VS debugger crashes with IE8.

How VS debugger could be crashed with IE8?

If you opened multiple instances of IE8 and you attempt to debug your project, you mostly will have the issue where VS debugger just stops and ignores your break points!

Why was that?

Well, IE 8 has a feature called Loosely-Coupled Internet Explorer (LCIE) which results in IE running across multiple processes.
http://www.microsoft.com/windows/internet-explorer/beta/readiness/developers-existing.aspx#lcie

Older versions of the Visual Studio Debugger get confused by this and cannot figure out how to attach to the correct process.

To overcome this issue, you need to disable the process growth feature of LCIE by follow the below steps:

1) Open RegEdit
2) Browse to HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main
3) Add a dword under this key called TabProcGrowth
4) Set TabProcGrowth to 0

If you run into the same problem on Vista or newer, you will also need to turn off protected mode.

And then go a head and start debugging your code.

Ref : Weblogs Asp.Net

How to disable the process termination by IIS when debugging

When you are writing code for your SharePoint solution, you’ll probably be testing and debugging that code as well. You deploy your solution, attach Visual Studio to the worker process and when the debugger hits the break-point, you examine what happens and read the values of your variables at that moment. And before you know it, you get the message that IIS has terminates the process that was being debugged.

The Windows Process Activation Service (WAS) pings an application pool’s worker process at set intervals for monitoring. If a worker process is non-responsive, WAS can shut it down. This WAS pinging is enabled by default and the interval is set to 90 seconds.

To avoid this you can either disable the Ping Enabled setting of the application pool of your web application or increase the Ping Maximum Response Time. From the Administrative Tools menu, start the Internet Information Services (IIS) Manager and expand your server. Select the Application Pools node. In the Application Pools list select your application of your web application and click on the Advanced Settings link.

Now set Ping Enabled to false (or increase Ping Maximum Response Time to 900) and save your settings by clicking the OK button.

Reference : Blog by Octavie