Remove and disable “Get Windows 10” icon

Microsoft seems to have pushed an automatic update to Windows 7/8/8.1 machines with an annoying popup in the notification tray exclaiming that you need to reserve your copy of Windows 10 immediately. If you’re like me, you wanted to figure out how to kill this thing for good. There’s a few ways you can do it. There’s a temporary until reboot way and a permanent way.

Temporary

On Windows 8.1, go to the Task Manager (right click the Task Bar, click Task Manager) or CTRL+ALT+DEL and then click Task Manager. The process you want to kill under the “Details” tab is called GWX.exe. Once you stop that process, the icon will go away. Be warned that it will come back when you reboot your machine.

Permanent

  1. Open the Control Panel and click Windows Update.
  2. Click Installed Updates in the lower left.
  3. Find the update named “KB3035583”, right click it, and uninstall.
  4. Go to “C:\Windows\System32\” in an Explorer window
  5. Right click the “GWX” folder, click Properties and then the Security tab
  6. Click Advanced and then click the “Change” button next to the Owner
  7. Change the user to your account or group that you use on the computer
  8. Click OK/Apply and then delete the “GWX” folder

Your computer is now free from that annoying popup, but make sure to hide the update in the Windows Update window if it ever comes back asking to be installed. This is a good time to remind everyone that they should set their Windows Update settings to Manual Installation so that you don’t get stuck with these botched updates automatically.… Read more

Setup a blank WordPress site in Azure

One of the reasons WordPress is hugely popular is because it’s super easy to setup and has a large developer base around it which is responsible for creating many useful plugins. If you’re interested in setting up WordPress in Azure, look no further! Make sure you understand the pricing structure of Azure before you go this route. Often, the cost isn’t really worth the return unless you have 5+ blogs that you want to setup on Azure. You can stick to the Free or Shared ($10/mo) tiers, but the performance can suffer quite a bit depending on your site’s popularity and you may not get certain features like custom domains and SSL support.

Azure can be a little confusing for newcomers who don’t realize that some functionality is split across two different portal/management sites. One of these (the “new” portal) is in Preview status while the other (the “old” portal) is the status quo which should be used for most operations. You can follow either section below to achieve the same result, though one may be simpler than the other depending on your use cases.

“Old” Azure Portal

  1. Login to the “old” Azure Portal with your Microsoft Account.
  2. In the lower left, click New > Computer > Web App > Quick Create.
  3. Enter the URL name that you want. If you end up selecting the Shared pricing tier or above (Basic, Standard, Premium) you will have the option of setting up a custom domain. See my guide to doing this with Namecheap. Other domain name services have similar features.
  4. Choose an App Service Plan to under which the web app will be setup. This is important because it could determine how much you pay since each App Service Plan has an associated pricing tier. App Service Plans are basically collections of apps and services that you own in Azure. These will share the same resources setup by the plan and under the same pricing tiers. Read more about App Service Plans.
  5. In the lower right, click Create Web App.CreateBlankWordpress1
  6. Under the Web Apps section of the portal, you should see your new web app being setup or running.
  7. Click the web app that you just created.
  8. Click the “Download publish profile” link under the “Publish your app” section.CreateBlankWordpress2
  9. Download and install your favorite FTP software (I use FileZilla).
  10. Download the latest WordPress version.
  11. Open the publish profile file and pull out the “publishUrl”, “userName”, and “userPWD” under the “publishMethod=FTP” section.
  12. Use the above credentials with your FTP software to connect to the web app’s FTP folders.
  13. Extract the downloaded WordPress zip and upload them to the /site/wwwroot/ folder.CreateBlankWordpress3

“New” Azure Portal

  1. Login to the “new” Azure Portal with your Microsoft Account.
  2. In the upper left, click New > Web + Mobile > Web App.
  3. Enter the URL name that you want. If you end up selecting the Shared pricing tier or above (Basic, Standard, Premium) you will have the option of setting up a custom domain. See my guide to doing this with Namecheap.
Read more

Custom authorization with ELMAH and ASP.NET Identity Framework

If you’re using any of the most recent ASP.NET MVC 5 project templates with authentication and authorization built in, then you’re probably using the ASP.NET Identity Framework. With any ASP.NET project, it’s smart to add references to the ELMAH library just in case any unhandled exceptions occur. You can use both of these libraries together to restrict access to the remote ELMAH page with custom authorization.

First, install the Elmah.MVC package from NuGet. This should download the correct libraries and add the necessary lines to your web.config.

Substitute the “your_user_name” entry with your own username that you’ve setup in the ASP.NET Identity Framework backend. For example, the AspNetUsers table in SQL Server contains your usernames. It appears that ELMAH does get the authentication information from the current thread principal, which the ASP.NET Identity Framework will establish on your behalf upon login.… Read more

The required anti-forgery cookie “__RequestVerificationToken” is not present.

In your ASP.NET MVC adventures, you may come across the following error when loading a view.

The required anti-forgery cookie “__RequestVerificationToken” is not present.

After searching Google for awhile, you might become desperate with the many different solutions presented. Normally, the solution to this issue is related to the ValidateAntiForgeryToken attribute on actions. When accessing a GET action, you don’t need to use the anti-forgery token.

However, this is not the only solution. In my case, my web.config had this entry:

Checking the project settings in Visual Studio revealed that my project was not set to use SSL which caused a conflict. Either comment out the above line or set the project to always use SSL.

See more solutions to this issue on this StackOverflow answer..… Read more

Redirect your azurewebsites.net URL to your custom domain URL

If you’ve attached a custom domain to your Azure Websites setup, you probably want people and search engine crawlers to use the custom domain URL instead of the free azurewebsites.net URL. You can setup your application’s web.config to include the following.

Add the following to the system.webServer section of your web.config, but make sure you replace the “yourdomain” text with your own domain information.

Read more

Connect WordPress to Custom MySQL with Azure VM

The title is a bit of a mouthful, but I promise it’s not as crazy as it seems. If you’re anything like me, you became interested in cloud computing and stumbled upon Microsoft’s Azure platform. There are plenty of wizards built directly in to the Azure Dashboard which allow you to automatically create and setup websites, virtual machines, and databases without ever needing to perform extra configuration. However, there are some cases where you might want to setup a custom database for a specific purpose. WordPress is one great example which may require you to setup your own MySQL databases in a virtual machine. In fact, this guide assumes that you already have a WordPress Azure Website setup.… Read more

Using SQL to insert all rows from a select

Inserting all rows from a select statement is a fairly common operation. You may be transferring the contents of one table to another or performing a complex multi-joined select and moving those values to another temporary table. The basic statement goes something like this:

You can modify this for your specific purposes like so:

Read more

Fixing Error 5: Access Denied when Starting a Windows Service

After creating your own Windows Service, you may encounter the following error:
53rgc

Sounds serious, but it’s not. It’s complaining that executable can’t be started because the account under which the service is running does not have access. When you installed the Windows Service, you had to choose a context like Local System, Local User, Network User, or something custom. In order to fix this issue, you need to give execute permissions to the user you chose. For example, NETWORK SERVICE account may need permission if that’s the context you chose to run the service.

Even after that hard work, you might still see an error like below:
Fp6Zq

This is a more generic error which indicates that something threw an exception during the OnStart method of the service. Since it’s so generic, there’s not really one solution to the problem. You need to check the Application Log in the Windows Event Viewer to understand what faulted the service. In some cases, it could be a bad application configuration (as one example).… Read more

Installing XNA 4 on Windows 8 / 8.1

Microsoft has long since abandoned XNA improvements, but that doesn’t mean you have to stop using the framework entirely. If you’re interested in installing the XNA framework on Windows 8 and 8.1, it can be a little tricky. Follow these steps.

Option 1

Source: http://blogs.msdn.com/b/astebner/archive/2012/02/29/10274694.aspx

  1. Download and install the latest version of the Games for Windows – LIVE Redistributable from http://www.xbox.com/en-US/LIVE/PC/DownloadClient
  2. If you are installing the Windows Phone SDK 7.1, re-run setup and choose to repair it. This will re-run the previously failing XNA Game Studio installers and they should install correctly this time.
  3. If you are install a standalone XNA Game Studio product, re-run setup and it should install correctly this time.
  4. If you are planning to do Windows Phone development, you should also install the Windows Phone SDK 7.1.1 Update after installing the Windows Phone SDK 7.1. This update fixes an issue that prevents the emulator in the Windows Phone SDK 7.1 from working correctly on Windows 8.

If you are installing the Windows Phone SDK 7.1, you can use the log collection tool to gather your setup log files. This log collection tool will create a file named %temp%\vslogs.cab.

If you are installing XNA Game Studio, you can find log files at the following locations:

  • XNA Game Studio 4.0 Refresh – %temp%\XNA Game Studio 4.0 Setup\Logs
  • XNA Game Studio 4.0 – %temp%\XNA Game Studio 4.0 Setup\Logs
  • XNA Game Studio 3.1 – %temp%\XNA Game Studio 3.1 Setup\Logs
  • XNA Game Studio 3.0 – %temp%\XNA Game Studio 3.0 Setup\Logs
  • XNA Game Studio 2.0 – %ProgramFiles%\Microsoft XNA\XNA Game Studio\v2.0\Setup\Logs

Option 2

This method may not be entirely legal, so only try it at your own discretion.

Use the download for VS2012 and VS2013 at this link: https://msxna.codeplex.com/releases. I have no idea of the legality on that project (the developers seem to have decompiled XNA), but it did help me ease the pain of needing VS2010 in order to utilize the content pipeline.… Read more

Custom error pages with ASP.NET MVC 5

So you created an ASP.NET application, hit a 404 Not Found error, and now you want to show something else other than the ugly default ASP.NET / IIS error pages, right? Well, sit back, because it’s rather annoying to setup properly. I strongly suggest reading the details that encouraged me to write this article. While that article definitely provides a majority of the setup required to make sure all cases and edge cases are handled when errors occur, there are some things that I had to do in order to make it all work properly.

Create a .html file and .aspx file for each error you want to handle. For example, 404.html and 404.aspx.

In the .aspx page, add this line below the “<%@ Page %>” directive where “xxx” is the error code you are handling such as 404 or 500.

In web.config, add this to your system.web section where each <error> section relates to whatever codes you are handling.

In web.config add this to your system.webServer section where each <remove> and <error> section relates to whatever codes you are handling.

Be sure to read through the originally linked blog to understand why you have to do certain things. I will say, however, that I had to fix a few things:

  • There was a missing semi-colon in the .aspx line for “Response.StatusCode”.
Read more