Wednesday, April 30, 2014

Authorize.Net Relay Response with ASP.NET

If you are using Authorize.Net as your payment engine and you are attempting to use Relay Response with ASP.NET, you will be disappointed to know that the code samples that Authorize.Net provides is only for Classic ASP!!  http://developer.authorize.net/downloads/samplecode/

Therefore, you are left to fend for yourself when it comes to developing a solution that is completely built on ASP.NET.

After simply converting the existing Classic ASP example over to ASP.NET, you end up with the following error message:

An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

      This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.


After digging through numerous Authorize.Net Developer Forums, I FINALLY discovered the answer to resolving this error message:

In the Page directive for the ASP.NET Relay Response page, you have to add the following attribute: EnableViewStateMac="false"

If this attribute is NOT present, you will inevitably receive the error message indicated above.
 
In addition, if you are using ASP.NET 4.0/4.5, I have found that a very basic Web.config file works for my ASP.NET Web Forms project, but other ASP.NET 4.5 Web.config files (such as those that are part of One ASP.NET) DO NOT WORK!!
 
<?xml version="1.0"?>
<configuration>
 
    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>
 
</configuration>


If you would like the code for the entire Relay Response page for ASP.NET Web Forms, I have provided it for you below:



<%@ page language="C#" autoeventwireup="true" codebehind="RelayResponse.aspx.cs" inherits="SIM_Example.RelayResponse" EnableViewStateMac="false"  %>
 
<!DOCTYPE html>
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Transaction Receipt Page</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="#FFFFFF">
    <form id="form1" runat="server">
        <%
   1:  
   2:               //Test to see if this is a test transaction.
   3:             if (TransID == "0" && ResponseCode == "1")
   4:             {
   5:  
   6:                 Response.Write("<table align='center'>");
   7:                 Response.Write("<tr>");
   8:                 Response.Write("<th><font size='5' color='red' face='arial'>TEST MODE</font></th>");
   9:                 Response.Write("<tr>");
  10:                 Response.Write("<th valign='top'><font size='1' color='black' face='arial'>This transaction will <u>NOT</u> be processed because your account is in Test Mode.</font></th>");
  11:                 Response.Write("</tr>");
  12:                 Response.Write("</table>");
  13:             }//if
  14:             Response.Write("<br>");
  15:             Response.Write("<br>");
  16:             //Test to see if the transaction resulted in Approval, Decline or Error
  17:             switch (ResponseCode)
  18:             {
  19:                 case "1":
  20:                     Response.Write("<table align='center'>");
  21:                     Response.Write("<tr>");
  22:                     Response.Write("<th><font size='3' color='#000000' face='Verdana, Arial, Helvetica, sans-serif'>This transaction has been approved.</font></th>");
  23:                     Response.Write("</tr>");
  24:                     Response.Write("</table>");
  25:                     break;
  26:                 case "2":
  27:                     Response.Write("<table align='center'>");
  28:                     Response.Write("<tr>");
  29:                     Response.Write("<th width='312'><font size='3' color='#000000' face='Verdana, Arial, Helvetica, sans-serif'>This transaction has been declined.</font></th>");
  30:                     Response.Write("</tr>");
  31:                     Response.Write("</table>");
  32:                     break;
  33:                 default:
  34:  
  35:                     Response.Write("<table align='center'>");
  36:                     Response.Write("<tr>");
  37:                     Response.Write("<th colspan='2'><font size='3' color='Red' face='Verdana, Arial, Helvetica, sans-serif'>There was an error processing this transaction.</font></th>");
  38:                     Response.Write("</tr>");
  39:                     Response.Write("</table>");
  40:                     break;
  41:             }//switch 
  42:  
  43:             Response.Write("<br>");
  44:             Response.Write("<br>");
  45:  
  46:             Response.Write("<table align='center' width='60%'>");
  47:             Response.Write("<tr>");
  48:             Response.Write("<td align='right' width='175' valign='top'>");
  49:             Response.Write("<font size='2' color='black' face='arial'>");
  50:             Response.Write("<b>");
  51:             Response.Write("Amount:" + "</b>");
  52:             Response.Write("</font>");
  53:             Response.Write("</td>");
  54:             Response.Write("<td align='left'>");
  55:             Response.Write("<font size='2' color='black' face='arial'>");
  56:  
  57:             Response.Write("$" + Amount);
  58:             Response.Write("</td>");
  59:             Response.Write("</tr>");
  60:  
  61:             Response.Write("<tr>");
  62:             Response.Write("<td align='right' width='175' valign='top'>");
  63:             Response.Write("<font size='2' color='black' face='arial'>");
  64:             Response.Write("<b>");
  65:             Response.Write("Transaction ID:" + "</b>");
  66:             Response.Write("</font>");
  67:             Response.Write("</td>");
  68:             Response.Write("<td align='left'>");
  69:             Response.Write("<font size='2' color='black' face='arial'>");
  70:             switch (TransID)
  71:             {
  72:                 case "0":
  73:                     Response.Write("Not Applicable.");
  74:                     break;
  75:  
  76:                 default:
  77:                     Response.Write(TransID);
  78:                     break;
  79:             }//switch 
  80:             Response.Write("</td>");
  81:             Response.Write("</tr>");
  82:  
  83:             Response.Write("<tr>");
  84:             Response.Write("<td align='right' width='175' valign='top'>");
  85:             Response.Write("<font size='2' color='black' face='arial'>");
  86:             Response.Write("<b>");
  87:             Response.Write("Authorization Code:" + "</b>");
  88:             Response.Write("</font>");
  89:             Response.Write("</td>");
  90:             Response.Write("<td align='left'>");
  91:             Response.Write("<font size='2' color='black' face='arial'>");
  92:             switch (AuthCode)
  93:             {
  94:                 case "000000":
  95:                     Response.Write("Not Applicable.");
  96:                     break;
  97:                 default:
  98:                     Response.Write(AuthCode);
  99:                     break;
 100:             }//switch 
 101:             Response.Write("</td>");
 102:             Response.Write("</tr>");
 103:             Response.Write("<tr>");
 104:             Response.Write("<td align='right' width='175' valign='top'>");
 105:             Response.Write("<font size='2' color='black' face='arial'>");
 106:             Response.Write("<b>");
 107:             Response.Write("Response Reason:" + "</b>");
 108:             Response.Write("</font>"); Response.Write("</td>");
 109:             Response.Write("<td align='left'>");
 110:             Response.Write("<font size='2' color='black' face='arial'>");
 111:             Response.Write("(" + ResponseReasonCode + ")");
 112:             Response.Write("&nbsp");
 113:             Response.Write(ResponseReasonText);
 114:             Response.Write("</font>");
 115:             Response.Write("<font size='1' color='black' face='arial'>");
 116:             Response.Write("</td>");
 117:             Response.Write("</tr>");
 118:             Response.Write("<tr>");
 119:  
 120:             Response.Write("<td align='right' width='175' valign='top'>");
 121:             Response.Write("<font size='2' color='black' face='arial'>");
 122:             Response.Write("<b>");
 123:             Response.Write("Address Verification:" + "</b>");
 124:             Response.Write("</font>");
 125:             Response.Write("</td>");
 126:             Response.Write("<td align='left'>");
 127:             Response.Write("<font size='2' color='black' face='arial'>");
 128:  
 129:             //Turn the AVS code into the corresponding text string.
 130:             switch (AVS)
 131:             {
 132:                 case "A":
 133:                     Response.Write("Address (Street) matches, ZIP does not.");
 134:                     break;
 135:                 case "B":
 136:                     Response.Write("Address Information Not Provided for AVS Check.");
 137:                     break;
 138:                 case "C":
 139:                     Response.Write("Street address and Postal Code not verified for international transaction due to incompatible formats. (Acquirer sent both street address and Postal Code.");
 140:                     break;
 141:                 case "D":
 142:                     Response.Write("International Transaction:  Street address and Postal Code match.");
 143:                     break;
 144:                 case "E":
 145:                     Response.Write("AVS Error.");
 146:                     break;
 147:                 case "G":
 148:                     Response.Write("Non U.S. Card Issuing Bank.");
 149:                     break;
 150:                 case "N":
 151:                     Response.Write("No Match on Address (Street) or ZIP.");
 152:                     break;
 153:                 case "P":
 154:                     Response.Write("AVS not applicable for this transaction.");
 155:                     break;
 156:                 case "R":
 157:                     Response.Write("Retry. System unavailable or timed out.");
 158:                     break;
 159:                 case "S":
 160:                     Response.Write("Service not supported by issuer.");
 161:                     break;
 162:                 case "U":
 163:                     Response.Write("Address information is unavailable.");
 164:                     break;
 165:                 case "W":
 166:                     Response.Write("9 digit ZIP matches, Address (Street) does not.");
 167:                     break;
 168:                 case "X":
 169:                     Response.Write("Address (Street) and 9 digit ZIP match.");
 170:                     break;
 171:                 case "Y":
 172:                     Response.Write("Address (Street) and 5 digit ZIP match.");
 173:                     break;
 174:                 case "Z":
 175:                     Response.Write("5 digit ZIP matches, Address (Street) does not.");
 176:                     break;
 177:                 default:
 178:                     Response.Write("The address verification system returned an unknown value.");
 179:                     break;
 180:             }//switch 
 181:             Response.Write("</td>");
 182:             Response.Write("</tr>");
 183:             Response.Write("</table>");
 184:         
%>
    </form>
</body>
</html>

 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace SIM_Example
{
    public partial class RelayResponse : System.Web.UI.Page
    {
        public string ResponseCode, ResponseReasonText, ResponseReasonCode, ResponseSubcode, AVS, ReceiptLink, TransID;
        public string Amount, AuthCode;
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Form.Count > 0)
            {
                //Retrieving and defining Form Data from Post command body from Authorize.Net
                ResponseCode = Request.Form["x_response_code"].Trim();
                ResponseReasonText = Request.Form["x_response_reason_text"].Trim();
                ResponseReasonCode = Request.Form["x_response_reason_code"].Trim();
                AVS = Request.Form["x_avs_code"].Trim();
                TransID = Request.Form["x_Trans_ID"].Trim();
                AuthCode = Request.Form["x_Auth_Code"].Trim();
                Amount = Request.Form["x_Amount"].Trim();
                ReceiptLink = "http://www.authorizenet.com";
            }//if
 
            
        }//event: Page_Load
    }
}


Sunday, April 27, 2014

Using Team Foundation Server 2013 with SQL Server Management Studio

You may know that SQL Server Management Studio does not provide any source control provider support out-of-the-box as is the case with editions of Visual Studio starting with Visual Studio 2010.

This can be shown by going into the Tools-->Source Control menu in SQL Server Management Studio:



Fortunately, there is a way to provide Team Foundation Server 2013 integration with SQL Server Management Studio.  You can use the MSSCCI Providers that are available free to download from Visual Studio Gallery:

TFS 2013 32-bit MSSCCI Provider
http://visualstudiogallery.msdn.microsoft.com/06c8e056-7f77-4a5c-9b8b-49318c143df8

TFS 2013 64-bit MSSCCI Provider
http://visualstudiogallery.msdn.microsoft.com/22d38324-051c-4f04-9379-ff78e7116c8d

Since SQL Server 2012 still only supports 32-bit, we will need to download and install the 32-bit MSSCCI Provider.

Once you install that provider, you will now see the following option in SQL Server Management Studio:


That is it!!  That is all you need to do to enable Team Foundation Server 2013 support for SQL Server Management Studio!

Thursday, April 24, 2014

Backing up Windows and Program Settings

With the Windows platform, you may have found there is a whole host of tools that can provide you with backup capabilities for your system.

Most backup tools will allow you to easily backup your file system or even IMAGE your entire computer!

You can find such tools like Acronis True Image to help you with these types of tasks:  http://www.acronis.com/en-us/personal/pc-backup/

Some backup tools will go even further and allow you to backup SOME Windows and Program settings such as Internet Explorer settings and your Outlook or Windows Mail settings.

You can find programs like Genie Backup Home 9.0 http://www.genie9.com/home/Genie_Backup_Manager_Home/Overview.aspx

OR

Easeus Todo Backup Home/Workstation:  http://www.easeus.com/backup-software/tb-home.html

However, what if you use browsers such as Mozilla Firefox or Google Chrome and you want to back up those settings as well?

Well, I have only found one Windows tool thus far that can accomplish that for me and that tool is BackRex Easy Backup: http://backsettings.com/easy-profile-backup.html

BackRex allows you to backup settings from Windows, Mozilla Firefox, Google Chrome, Internet Explorer, Outlook as well as several other programs.

Overall, the cost of the software is very affordable and very useful if you find that your SETTINGS are just as important as your FILES:http://backsettings.com/order.html

As you have obviously guessed by now, this tool is invaluable for me and therefore I keep it as part of the standard software I need for my Windows workstations.  Perhaps you will find this tool just as useful and handy as I do!


Wednesday, April 23, 2014

Dealing with Trust Issues using Self-Signed Certificates

If you use Self-Signed Certificates to secure your websites in IIS, you probably have received this dreaded message in Internet Explorer at least once:


Well, fortunately, you can get rid of this client error message relatively easily by following these steps:


  1. Click on the Internet Explorer Toolbar to View the Certificate
  2. Follow the steps to Install the Certificate on your Local Machine
  3. When prompted for the location to store the Certificate, select "Trusted Root Certification Authorities" 
  4. Once you have imported the certificate, you will probably have to restart Internet Explorer
  5. Now when you browse to the website, you should no longer receive the Certificate error message! 







Automatic Windows Live Login using Internet Explorer on Windows 8.1

If you have recently upgraded to Windows 8.1, you may have noticed that, by default, Microsoft will attempt to have you sign into your computer using your Windows Live ID.

If you agree to that and set up your Windows Live ID as your primary login into your Windows 8.1 local computer, you end up with a side effect in Internet Explorer.

Many business users are familiar with the concept of NTLM logins which allow you to log into your local computer and then seamlessly log into any number of business Intranet websites that are also secured with your Windows NTLM credentials.

However, with the introduction of Windows Live ID authentication, you now get this experience with your Windows Live ID!

Therefore, when you attempt to log into any Microsoft-based websites that required authentication using a Windows Live ID, once you click on the Login link, you will be seamlessly logged into the system using the credentials from your local machine!

For many users, this may be a positive experience because it avoids having to remember separate logins for various Microsoft-based sites.

However, what if you need to use a separate Windows Live ID to log into a system (for example, you have separate personal and business Windows Live ID accounts)?

So what is the workaround??

One of the workarounds is to simply allow the sign in process to occur and then once you are signed into the site, simply click on the "Sign Out" link and you will then be able to log in with your alternative Windows Live ID.


The other workaround is to use an alternative browser such as Mozilla Firefox or Google Chrome to log into these Windows Live ID secured websites.  Since these browsers IGNORE your local computer's Windows Live ID credentials, you will be able to readily log into these Microsoft websites with a separate Windows Live ID.

Tuesday, April 22, 2014

Could not create Windows task to upload CEIP data.

When I was recently trying to install Workflow Manager 1.0 Refresh for my SharePoint 2013 Farm, at the end of the Workflow Manager installation, I received the following error message:

Could not create Windows task to upload CEIP data.  Exception An error occurred while registering scheduled job definition Workflow Manager 1.0 CEIP Uploader Task to the Windows Task Scheduler.  The Task Scheduler error is:  A specified logon session does not exist.  It may already have been terminated (Exception from HRESULT: 0x80070520).
Microsoft.Workflow.Deployment.Commands.WFFarmInfo

After I did a bit of research, I discovered that "CEIP" stands for "Customer Experience Improvement Program", therefore, this was just the feedback mechanism to report issues back to Microsoft.

If you have no concerns about reporting feedback to Microsoft from your Workflow Manager application, then you should be able to safely ignore this error message!

The Fabric Data Collection Agent is disabled for this deployment for Workflow Manager 1.0 installation and AutoSPInstaller

While I was installing Workflow Manager 1.0 Refresh on my SharePoint 2013 Server, I encountered the following error message:

The Fabric Data Collection Agent is disabled for this deployment.

According to several articles, the issue stems from a modification made to the HOSTS file pointing to the 127.0.0.1  (loopback address) to resolve DNS entries/Urls.

Well, initially, I did not think of checking the HOSTS file because I did not manually modify the HOSTS file myself.

But, after the 2nd failed installation, I decided to double check the HOSTS file to see if there truly was any such entry.

Sure enough, there was such an entry!

Even more interesting, this entry was added as part of the AutoSPInstaller installation process!

127.0.0.1    SharePointServer    #Added by AutoSPInstaller to locally resolve SharePoint URLs back to this server

Once I commented out this line from the HOSTS file, my Workflow Manager 1.0 Refresh installation proceeded successfully!

In order to prevent entries from being added to the HOSTS file by AutoSPInstaller, you can uncheck the "Add URL to HOSTS" checkbox in AutoSPInstaller GUI.


Monday, April 21, 2014

Upgrading to Sitefinity v. 7.0

 

If you have downloaded the latest release of Sitefinity v. 7.0 and have attempted to upgrade to this release from any prior release, you may have already discovered that there are some problems with the upgrade process.

Most notably, this version of Sitefinity, unlike previous versions of Sitefinity requires a web.config upgrade. 

As you can probably guess, this process is incredibly fraught with problems.

I have personally tried upgrading 4-5 Sitefinity v. 6.x projects and NONE of them have succeeded with the automatic Web.config upgrade!

So what do you do?

Well, the recommendation from Sitefinity Support is to upgrade from a particular release to the release versions they specify in this article: http://www.sitefinity.com/documentation/documentationarticles/installation-and-administration-guide/upgrade

Otherwise, you can simply manually upgrade directly to Sitefinity v. 7.0 by following the steps outlined below:

  1. Create a blank/empty Sitefinity v. 7.0 project
  2. Upgrade the Sitefinity project to Sitefinity v. 7.0 using the Sitefinity Project Manager as usual
  3. When it comes to the Web.config upgrade, you will choose “No” to have the Sitefinity Project Manager automatically upgrade your Web.config file
  4. After your project has been upgraded to Sitefinity v. 7.0, examine the Web.config file from the blank/empty project Sitefinity v. 7.0 project you created earlier and compare it with your existing Sitefinity project’s Web.config file using a tool such as Beyond Compare (http://scootersoftware.com/) or DiffMerge (http://sourcegear.com/diffmerge/downloads.php) or UltraCompare (http://www.ultraedit.com/downloads/ultracompare_download.html)
  5. Then merge the changes from the Sitefinity v. 7.0 Web.config into your existing Web.config file.
  6. Verify that the upgraded Sitefinity v. 7.0 project now works successfully.

Working with the DropDownList control in ASP.NET MVC


If you are using Model Binding with ASP.NET MVC, one of the most confusing control elements is the use of the DropDownList control.
Unlike the TextBox controls and other simplistic input controls, the DropDownList control requires a collection of items.  Even more so, it requires a Name/Value pair collection of items in order to populate the collection.  On top of that, in the [HttpPost] method in your Controller, you need to be able to get the selected value from the DropDownList control and use it for any additional operations you need to perform.
Well, to get started, in order to set up Model Binding for a DropDownList control, you will need to set up a property in your Model similar to this:
public IList<SelectListItem> Countries {get; set;}

However, since you cannot use that property to send back the value to your [HttpPost] method, you will need to set up an additional property to hold the value returned when the Page is posted such as this:


public string SelectedCountry {get; set;}

Finally, you will need to set up the binding in your ASP.NET MVC View:


@Html.DropDownListFor(model=>model.SelectedCountry, Model.Countries, "--Select—")

Now, when you need to access the value from the DropDownList, you can simply use the model.SelectedCountry property value!

NOTE: One of the quirks in using the DropDownList control in ASP.NET MVC is that if your View fails ModelState validation, since there is no ViewState (unlike ASP.NET Web Forms), the contents of the DropDownList will not be available in the [HttpPost] method if you bound the results in the [HttpGet] method (for example, by loading the values from a database or an XML file by using a LINQ query).  Therefore, you will have to RE-BIND any populated content values in the [HttpPost] method as well in order to avoid any exception messages (especially if you are simply returning the same View bound to the model i.e.

If you think that Microsoft should improve the handling of DropDownLists in ASP.NET MVC to make it easier to persist as part of model data, then you should vote for this UserVoice item here:

http://aspnet.uservoice.com/forums/41201-asp-net-mvc/suggestions/7057754-make-it-easier-to-persist-collection-data-for-drop

Configuring Alternate Access Mappings (AAM) in SharePoint

 

I recently needed to configure a SharePoint environment with a DNS entry (FQDN) instead of the server name under which it was currently installed and configured.

Well, as you can probably guess, the most obvious method of doing this was to go into “Alternate Access Mappings” and add the FQDN to the appropriate zones such as Intranet, Internet, Extranet and Default.

However, after configuring this, I noticed that I could not access SharePoint via those new DNS entries (at least on the local server)!

Instead, I was stuck in an infinite loop of authentication prompts that would never allow me access to the SharePoint site!

Fortunately, it seems this issue is (relatively) well documented and all articles point to this Microsoft Support Knowledgebase article: http://support.microsoft.com/kb/896861/en-us

This article is the infamous “DisableLoopbackCheck” article which is a MUST for SharePoint installations.

If you are using a tool such as AutoSPInstaller (http://autospinstaller.codeplex.com/), this is already incorporated as part of the scripted installation.

Of course, since this was a manually installed and configured SharePoint installation, I needed to do it myself.

Of course, since I love to automate things and make them reusable, I decided to script these operations for myself using Windows PowerShell:

Method 1 (Recommended method):

$hostNames = "mysharepointhost.contoso.com"
New-ItemProperty HKLM:\System\CurrentControlSet\services\LanmanServer\Parameters -Name "DisableStrictNameChecking" -Value 1 -PropertyType "DWORD" -Force
New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa\MSV1_0 -Name "BackConnectionHostNames" -Value $hostNames -PropertyType "MultiString" -Force

Method 2:



New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck" -Value 1 -PropertyType "DWORD" -Force

I hope this helps anyone facing similar issues when configuring their SharePoint installations with AAM!

Sunday, April 20, 2014

PayPal Express Checkout with an Optional PayPal account

If you are integrating with PayPal Express Checkout, you may want to allow your customers to be able to checkout WITHOUT having a PayPal account.

By default, PayPal Express Checkout will require a PayPal account for you to checkout.

However, if you pass the right parameters to the PayPal Payment Gateway, it will allow you to optionally checkout without having a PayPal account. 

In order to do this, you have to have the following parameters in your ASP.NET PayPal Express Checkout method:

encoder["SOLUTIONTYPE"] = "Sole";
encoder["LANDINGPAGE"] = "Billing";


If you are using the PayPal Integration Wizard, this code can be included in your paypalfunctions.cs file.


Once you have this in place, your customers will be able to optionally pay by credit card WITHOUT having a PayPal account!

Saturday, April 19, 2014

SQL Server Business Intelligence Tools for Visual Studio 2013

If you are trying to develop SQL Server Reporting Services Reports using Visual Studio 2013 simply by installing "SQL Server Data Tools" that is included with the installation of Visual Studio 2013, unfortunately, you are out of luck.

Normally, the only way to get this capability was by installing the "SQL Server Data Tools" that were included with an installation of SQL Server!  Of course, if you installed SQL Server 2012, you ended up with a Visual Studio 2010 Shell to create these SQL Server Reporting Services reports.

Well, fortunately, Microsoft has now offered a way to create these reports using Visual Studio 2013 through an additional installation of "Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2013".  You can download these tools from here: http://www.microsoft.com/en-us/download/details.aspx?id=42313

This is what the installation of the Visual Studio 2013 Business Intelligence Tools looks like:







Friday, April 18, 2014

Setting up SSL Certificates on SharePoint 2013

If you need to set up an SSL Certificate on your SharePoint 2013 Server, this is an excellent article on how to set this up reliably:

http://blogs.msdn.com/b/fabdulwahab/archive/2013/01/21/configure-ssl-for-sharepoint-2013.aspx

If you are using a 3rd party SSL certificate such as from Entrust or various other SSL certificate vendors such as GoDaddy, RapidSSL, Symantec, GeoTrust or various others, you should only need to apply the SSL certificate to IIS and configure the Alternate Access Mappings.

Tuesday, April 15, 2014

"The requested content appears to be script and will not be served by the static file handler" error message on IIS 8.5/Windows Server 2012 R2

I was recently installing Sourcegear Vault on my Windows Server 2012 R2 server when I received the following error message:

Well, based on past experience, I figured that I would have to run the aspnetregiis -i command at the command prompt in order to get the ASP.NET Script Mappings appropriately configured.

Well, much to my surprise, I encountered the following error message:



Therefore, I could no longer use this tried and tested command to register ASP.NET 4.0/4.5 in IIS!  I would have to do it manually through Add/Remove Windows Features!!

Well, fortunately, I had Microsoft Web Platform Installer installed on my computer, so I simply used that to install and configure ASP.NET 4.5 for me!


After doing that, my ASP.NET Web Applications were working just fine!

Saturday, April 12, 2014

PayPal Classic API Error Message--Order Total Is Missing

I was recently using the PayPal Classic API with ASP.NET by generating the appropriate ASP.NET and C# files using the PayPal Integration Wizard: https://devtools-paypal.com/integrationwizard/

However, once I downloaded the code and began using it, I kept on encountering this error message from the API: "Order total is missing"

After going back and forth with PayPal Technical Support, they were not able to determine the root cause of the problem in the source code, however, they told me that the version number information was WRONG!

The version number was being sent as "2.3", when it should be a much later release such as "112.0"!!  The list of version numbers can be found here: https://developer.paypal.com/webapps/developer/docs/classic/release-notes/#MerchantAPI%29

After digging around in the source code a bit further, I discovered that this function was responsible for generating the incorrect version number!

/// <summary>

    /// Credentials added to the NVP string

    /// </summary>

    /// <param name="profile"></param>

    /// <returns></returns>

    private string buildCredentialsNVPString()

    {

        NVPCodec codec = new NVPCodec();

 

        if (!IsEmpty(APIUsername))

            codec["USER"] = APIUsername;

 

        if (!IsEmpty(APIPassword))

            codec[PWD] = APIPassword;

 

        if (!IsEmpty(APISignature))

            codec[SIGNATURE] = APISignature;

 

        if (!IsEmpty(Subject))

            codec["SUBJECT"] = Subject;

 

        codec["VERSION"] = "2.3";

 

        return codec.Encode();

    }
After I changed the source code to the following:

/// <summary>

    /// Credentials added to the NVP string

    /// </summary>

    /// <param name="profile"></param>

    /// <returns></returns>

    private string buildCredentialsNVPString()

    {

        NVPCodec codec = new NVPCodec();

 

        if (!IsEmpty(APIUsername))

            codec["USER"] = APIUsername;

 

        if (!IsEmpty(APIPassword))

            codec[PWD] = APIPassword;

 

        if (!IsEmpty(APISignature))

            codec[SIGNATURE] = APISignature;

 

        if (!IsEmpty(Subject))

            codec["SUBJECT"] = Subject;

 

        codec["VERSION"] = "112.0";

 

        return codec.Encode();

    }

I was successfully able to submit my PayPal Express Checkout payment!

Therefore, as a word to the wise, the PayPal Integration Wizard is outdated and defective.  However, by simply changing the version number in your resultant source code, you should be able to have a workable solution.  

Thursday, April 10, 2014

Sitefinity v. 7.0 has been released!

PowerGUI has moved!

I was just trying to download the latest version of PowerGUI from http://www.powergui.org when I was suddenly redirected to a Dell site!!

Of course, as you can guess, I could not easily find a link to PowerGUI anywhere on the website, but after doing some Google searching, I was finally able to come upon the new home page of PowerGUI: http://en.community.dell.com/techcenter/powergui/

I imagine that it might be quite a few days before the new PowerGUI Home Page shows up reliably in search results, so hopefully this will help those individuals searching for PowerGUI downloads.

Wednesday, April 9, 2014

SharePoint 2013 Offline Prerequisites

If your SharePoint server does not have an Internet connection or you are using a scripted installer such as AutoSPInstaller or you simply want to save time on your installation of SharePoint 2013, chances are that you will want to download all of the prerequisites required for SharePoint 2013 so that you have the offline installers.

In this TechNet article, you can find the complete list of applicable prerequisites needed for installing SharePoint 2013:  http://technet.microsoft.com/en-us/library/cc262485%28v=office.15%29.aspx

However, if you are only interested in the prerequisites needed for the Prerequisite Installer that comes with SharePoint 2013, this TechNet article specifically targets those prerequisites: http://blogs.technet.com/b/meamcs/archive/2012/12/26/install-and-download-sharepoint-2013-prerequisites-offline-manually.aspx

Changing the database connection string in nopCommerce

In most ASP.NET Web Sites/Web Applications, you expect the database connection string to be stored in the connectionStrings element in the Web.config file.

However, while using nopCommerce, you will notice that there is no connectionStrings element in the Web.config file!!

Therefore, where do you change the database connection string for nopCommerce?

The database connection strings is actually stored in a file called Settings.txt.  This file is located at the root of the App_Data folder in the website.

You can simply change the database connection string in this file to point to a new database (for example when migrating from a development environment to a staging or production environment).

Sunday, April 6, 2014

SQL Server 2014 has been released!

SQL Server 2014 has been released and is now available for download from MSDN Subscriptions here: http://msdn.microsoft.com/subscriptions

You can read more about what is new in SQL Server 2014 here: http://msdn.microsoft.com/en-us/library/bb500435(v=sql.120).aspx

Thursday, April 3, 2014

Working with the PayPal API using ASP.NET

If you need to work with the PayPal API, you have 2 choices to choose from:


  • Classic API
  • REST API
As you can probably guess, the REST API is newer and therefore the preferred method of integration.

However, if you need work with the Classic API and you need to use Express Checkout, PayPal makes it quite easy for you to integrate your code with the language of your choice using the PayPal Integration Wizard: https://devtools-paypal.com/integrationwizard/

Unfortunately, the PayPal Integration Wizard does not support code samples for integrating with ASP.NET MVC, therefore, you are stuck with ASP.NET Web Forms if you are planning on using the Wizard.

The PayPal Integration Wizard simply asks you a series of questions and then provides you with necessary integration code to include in your ASP.NET Web Forms files.  The main point to note is that you will need to create a Session variable called "payment_amt" in order to store the PayPal payment amount to submit to the PayPal site.

If you are planning on using the PayPal REST API, you can download code samples from here: https://github.com/paypal/rest-api-sdk-dotnet



From the right hand lower corner, simply click on the link to "Download ZIP".  Once you extract the .zip file, you should be able to see the "Samples" folder containing the code samples for various versions of Visual Studio up to Visual Studio 2012.

Unfortunately, as with the PayPal Integration Wizard, the code samples are provided only for ASP.NET Web Forms.

When you open the Visual Studio 2012 Solution initially in Visual Studio 2013, you will notice that the RestAPISDK reference is missing.


Fortunately, since this package is managed through NuGet, this can be easily rectified!

You can simply go to "Manage NuGet Packages" and search for "PayPal REST API SDK".  This should return the appropriate search result and allow you to install the package for  your solution.





Once the NuGet package has been updated, you should be ready to work with the PayPal REST API code samples!