Windows 10 – Changing the Default Browser

If you upgrade to Windows 10 from a prior version, it changes your default browser setting to Microsoft’s new browser called “Edge”.  It’s really simple to change it back.

  1. Click the search icon in the lower left corner of your screen.
  2. Type default browser
  3. At the top of the search results, “choose a default web browser” will be highlighted.  Just click it.
  4. On the settings window that comes up, scroll to where you see “Web Browser”, then click the browser name shown in the drop down list under it.  It’ll show you a list of browsers on your machine.  Just choose your favorite and you’re done.

The Mozilla CEO wrote a nastly, open letter complaining that Microsoft changed the default selection (which they did), but he also claimed that it’s very difficult to change it back.  Clearly, he’s wrong about that part.

See these images?

image

You’ll find actual working versions of them at the top and bottom of this article. Please click the appropriate buttons in it to let your friends know about this article.

Check back later for updates too!

Windows 10 Virtual Desktops

Windows 10 has a nice new feature called “Virtual Desktops”.  I should say that it’s only new to Windows because Mac & Linux users have had this feature for a long time.  Now it’s a fully supported feature in Windows as well.

What is a virtual desktop?

It’s kind of like having 2 monitors, but only being able to see one of them at a time.

 

How to activate the feature:

First, click the “Task View” button next to your search button on the task bar on the lower left of your screen.

image

You’ll be shown all the current virtual desktops you have.  If this is your first time, you’ll only see your current desktop shrunk down to the middle of the screen.  Now, on the lower right corner, click “New desktop”.  It has a large “+” above it.

image

That created your new, virtual desktop.  Now you have 2 thumbnails in the lower, middle of your screen.  Each thumbnail represents one of your virtual desktops.  Just click the one you want to enlarge to full screen.

image

Click the “Task View” button again to switch back to any virtual desktop you have.

See these images?

image

You’ll find actual working versions of them at the top and bottom of this article. Please click the appropriate buttons in it to let your friends know about this article.

Check back later for updates too!

Share

Add a web.config transform and a publish profile in Visual Studio 2013

If you need to deploy your app to multiple environments, like in most corporate IT shops (dev, QA, Staging, Training, Production, etc…), then you’ll need to have multiple versions of your config files, or better yet, one config file and “transform” files (one for each deployment environment) that describe ONLY the differences between the main config file and that particular environment.

For example, the connection string in the QA environment is likely different than the connection string in your Dev environment, which is different than your QA environment and again different in your live Production environment.

[GARD]

I’m not going to explain how to WRITE a config transform (how to tell it what needs to change).  At least, not in THIS article.  But I will tell you how to tell Visual Studio that you have multiple environments and how to make Visual Studio create the basic config transforms for you.

In this example, I’m creating a WCF Service application (works the same with pretty much any web type of application).

  1. Are you deploying a NON Asp.Net app (like a click-once app or a WinForms or WPF app)?  If so, install the Nuget package “Slow Cheetah”.  Why?  Because Visual Studio has built in support for all this for web.config files, but NOT for app.config files.  Slow Cheetah lets you make transforms for ANY file in your project.
  2. Right-Click your project and choose “Publish…”transform_01
  3. In the “Publish Web” dialog, choose “Custom”transform_02
  4. Give it a name.  NOTE!  If you have a different admin managing your deployment and/or build servers, you may want to check with them on what name to use, because it will make a difference between whether your stuff works or doesn’t!  For this example, I’ll call the transform “QA”transform_03
  5. Choose your deployment method (web publish, file copy, etc…).  For this example, I’m choosing “File System” since it requires fewer settings to fill out and I’m going to leave “Target location:” blank.  My deployment admin will fill that in later, so I don’t even need to know this.  Click “Next”.
  6. Choose whether this deployment should be a “Release” or a “Debug” deployment.  This will cause it to build it as debug or release. (You will also have a debug and a release transform of your web.config file and this new QA transform will inherit from either of those).transform_04
    1. Expand “File Publish Options” and check the items you need, then click “Next”
  7. Final screen in the wizard.  Click “Close”.  You can’t click “Publish” if you left the target path blank above.

[GARD]

You’ve now successfully created a publish profile.

transform_05 QA done

Now you’ll need to create a Web.config transform for this profile.

  1. Rich-Click your QA.pubxml file and choose “Add Config Transform”.  Do NOT choose “Add Transform” if you have Slow Cheetah installed.transform_06 QA Add Transform

You now have a new Web.QA.config file.

transform_07 Complete

You can now code your base Web.config file the way you need it to run locally during development.  In your Web.QA.config file, you can add transforms to modify settings in your web.config file so that when you build for that environment, Visual Studio will produce a web.config file that’s right for that environment.

You can repeat these steps to add as many publish profiles as you need.

See these images?

image

You’ll find actual working versions of them at the top and bottom of this article. Please click the appropriate buttons in it to let your friends know about this article.

Check back later for updates too!

 

 

 

Today’s best hard drive prices

This pricing data was collected on 2015/03/15 from Newegg.com.  I filtered by 3.5” drives and by each capacity they offered, sorted by lowest price, and have listed the lowest price drive in each capacity offered.  I’ve put them in a spreadsheet and added a column showing the price per TerraByte, and sorted by that.  This will give you the absolute best deal (best if price per TB is your main criteria) as the first drive listed and the worst price at the bottom of the list.

[GARD]

Here’s how to put your mind at ease to ensure you’re getting the best price on hard drives:

Hard drive prices change daily, so the actual price data I’m showing here is only relevant for a month, at best.  So use the technique in the linked article above to find your best prices from your favorite store at the time you need it.

Here’s a readable screenshot of today’s best prices per capacity available on Newegg.com:

image

The following is not as readable, but at least the links are clickable, unlike the image above.

[GARD]

$29.44    <– Min Price/TB       
Price/TB    TB    Price    Link
$29.44    2    $58.88    http://www.newegg.com/Product/Product.aspx?Item=9SIA5AD2M15415
$30.00    3    $89.99    http://www.newegg.com/Product/Product.aspx?Item=N82E16822236098
$35.00    4    $139.99    http://www.newegg.com/Product/Product.aspx?Item=N82E16822178338
$37.50    8    $299.99    http://www.newegg.com/Product/Product.aspx?Item=N82E16822178748
$39.00    5    $194.99    http://www.newegg.com/Product/Product.aspx?Item=N82E16822178752
$41.50    6    $248.99    http://www.newegg.com/Product/Product.aspx?Item=N82E16822236797
$46.95    1    $46.95    http://www.newegg.com/Product/Product.aspx?Item=9SIA5AD2N65236
$51.93    0.75    $38.95    http://www.newegg.com/Product/Product.aspx?Item=9SIA5AD2HS9891
$59.99    1.5    $89.99    http://www.newegg.com/Product/Product.aspx?Item=N82E16822236883
$71.98    0.5    $35.99    http://www.newegg.com/Product/Product.aspx?Item=N82E16822148787
$75.38    2.5    $188.45    http://www.newegg.com/Product/Product.aspx?Item=9SIA0AJ1N07310
$130.39    0.64    $83.45    http://www.newegg.com/Product/Product.aspx?Item=9SIA0AJ1MP2002
$144.19    12    $1,730.23    http://www.newegg.com/Product/Product.aspx?Item=9SIA24G1E34379
$166.65    0.6    $99.99    http://www.newegg.com/Product/Product.aspx?Item=N82E16822178479
$175.50    0.8085    $141.89    http://www.newegg.com/Product/Product.aspx?Item=9SIA67S23Y8983
$416.58    1.2    $499.89    http://www.newegg.com/Product/Product.aspx?Item=9SIA67S2709964
$472.29    1.8    $850.12    http://www.newegg.com/Product/Product.aspx?Item=9SIA24G2NU4473
$568.83    0.9    $511.95    http://www.newegg.com/Product/Product.aspx?Item=9SIA75M2FX7519

[GARD]

See these images?

image

You’ll find actual working versions of them at the top and bottom of this article. Please click the appropriate buttons in it to let your friends know about this article.

Check back later for updates too!

It’s YOUR fault GMail puts important E-Mail in the SPAM folder!

That’s right!  Did you know that Google’s GMail spam filter is largely based on its users marking e-mail as spam?  For example, if you voluntarily signed up for an e-newsletter, then decide you don’t want it anymore, if you mark it as spam, which it is not! because you asked for it! then other people, who also signed up for it stop getting it because when enough of you mark the SAME e-mail (which is NOT spam) as “spam”, GMail considers it spam and starts moving it into the spam folder of every GMail user that subscribes to it.

[GARD]

What you can do to stop the madness

It’s your civil and moral responsibility to unsubscribe from e-mail that you signed up for.  In every legitimate E-Mail subscription that you signed up for, each issue e-mailed to you will have an unsubscribe link, usually somewhere at the bottom.   USE THAT unsubscribe link instead of giving a false spam report.

I recently received a letter in the mail from a financial firm for which I do business and have money in.  The letter said that they haven’t heard from me in a while and were about to give my account to the state as an “abandoned” account.  After going through my GMail spam folder, I see that SAME letter in there from weeks earlier!  You know why it’s there?  Because some people that did or do business with this firm decided they didn’t want to receive any more mail from them and instead of doing the right thing and properly unsubscribing, they marked it as spam in GMail.  That caused the GMail servers to automatically move everyone else’s into the spam folder too!

So, STOP DOING THAT!

Of the 76 e-mail messages in my spam folder for the past 30 days, only 6 of them were legitimate spam.  Why?  See above.  You are destroying the reliability of the GMail spam filters.

[GARD]

Your actions online don’t always just affect you.  In this case, they have a detrimental effect on other users.  Sure, this is definitely partly Google’s fault, but it’s also partly your fault too (if you’re one of the ones doing this).

So, please stop doing this and please pass the word along so others stop doing it too.

See these images?

image

You’ll find actual working versions of them at the top and bottom of this article. Please click the appropriate buttons in it to let your friends know about this article.

Check back later for updates too!

Stick it to the NSA: How to Encrypt your WebMail

If you access your email from your desktop web browser, then follow these instructions to get email encryption working.  This is an initial draft.  I’ll expand some of the steps very soon.

  1. Install the Google Chrome  or Firefox browser if you haven’t already and install the extension named “Mailvelope” from https://www.mailvelope.com
  2. Once installed, there’ll be a new lock icon on the top right of your browser.  Click it and a menu opens.  Choose “options”.
  3. If you haven’t, at some time in the past, already created a private and public key pair, you’ll need to do that now.  If you don’t know what I’m talking about, you haven’t and you’ll need to do it now.  Click “Generate Key”.
  4. Once generated, it’s critical that you back up your private key, encrypted, to a place that no one can get it and that will last longer than your current hard drive and PC.  If you lose it, you’ll NEVER be able to read ANYTHING you’ve encrypted with your keys!  Install LastPass.com, create a secret note, and put your private key in there for long term, encrypted, safe storage.  Mark the note as “must reprompt for password”.  NEVER, EVER give anyone your private key.  NEVER send it unencrypted over the internet.  NEVER email it in an unencrypted e-mail message!  NEVER send it unencrypted over a wireless network, especially an open or public one.
  5. No one can send you encrypted e-mail unless they have your PUBLIC key.  Publish your PUBLIC key to a key server.  DO NOT PUBLISH YOUR PRIVATE KEY!!!!!!!! EVER!!!

Now, when you use GMail or most any of the other popular, free e-mail services in a  desktop browser, you can send and receive encrypted e-mail.  NOTE!  Just because you have the ability to send and receive encrypted e-mail does NOT mean that all your e-mail will be encrypted.  You MUST understand the following:

  1. Nothing you did here encrypted any of your old email.
  2. New email that comes in will usually be in clear text (NOT encrypted).
  3. When you start a new email message, Mailvelope will recognize this and provide you an icon, overlayed in your new email window.  Click it to write your email, then click “encrypt” to encrypt the email.
  4. You CANNOT send encrypted email to people that aren’t already set up, like you are, to send and receive encrypted email.
  5. You can’t send encrypted e-mail to anyone from whom you’ve not acquired their public key.
  6. You acquire public keys by searching on a key server.  MIT’s key server is here:. https://pgp.mit.edu
  7. Use the Mailvelope menu to import the public key of each individual with whom you wish to send encrypted email to.  You’ll find that most people have NOT registered a public key, so  you cannot participate in encrypted email with them.
  8. Once you encrypt and send an email message, you won’t be able to read it from your sent box.  It’ll be there, but encrypted with THEIR public key.  Only THEIR private key can decrypt it.  So, send it to both them AND yourself, THEN you can read it.
  9. Encrypted email is unreadable even by Google’s servers, which means you CANNOT use the Google email search feature for words in encrypted mail.
  10. ONLY the BODY of the email is encrypted, not the subject line, not the TO address, not your FROM address, not any part of the headers.

Things to note about HOW the keys work:

  1. When you generate keys, you only do it once, unless you have multiple email addresses.  In which case, generate a key pair for each of your email addresses you wish to send and receive encrypted email for.
  2. Keys are  created in pairs:  One is public.  The other is private.
  3. Feel free to give away your public key to ANYONE, ANYWHERE, ANYTIME.  Shout it from the mountain tops.
  4. Protect your private key with your life.  Well, don’t die for it, but it’s critical you protect it!  If anyone EVER acquires it, they can read EVERYTHING you’ve ever encrypted with your public key!
  5. Your public and private keys are intimately, mathematically connected.  Anything encrypted with your public key can ONLY be decrypted with your private key and  vice versa.
  6. Nothing is safe if you encrypt it with your private key, because everyone has your public key and can easily decrypt it.  A side benefit is you can do this to prove YOU are the one that created the message.  This is called “digitally signing” your document.
  7. If you want to encrypt something that ONLY YOU can decrypt, encrypt it with your PUBLIC key.  Decrypt it with your PRIVATE key.

Creating a NuGet package

This is a short and dirty post, which does NOT cover every possibility.  This post assumes you’re done writing and testing your project and are now ready to deploy as a NuGet package, that you’re on a Windows PC, and are using Visual Studio.

[GARD]

  1. Open a PowerShell command prompt and CD into your project folder where your .csproj file lives.
  2. type nuget spec
    1. You might have to do:  nuget spec -f  to overwrite an existing nuspec file.
  3. Edit the *.nuspec file created and change the variables you need.  Note that the ones with $stuff$ are pulling from your Assembly.cs file.  Edit your Assembly.cs file to have the right stuff so you don’t have to re-enter it every time here.
  4. Some things in .nuspec don’t have attributes in the Assembly.cs file, so you’ll have to manually enter them, such as:
    1. Update text
    2. Tags
  5. Save the .nuspec file.
  6. From the PowerShell command line, type:  nuget pack MyProjectName.csproj
    1. or nuget pack MyProjectName.csproj -IncludeReferencedProjects  to make sure it includes the stuff it references.
  7. Now, copy your package file to your nuget repository and it should be available to other developers from within Visual Studio’s NuGet package manager.

 

 

SQL Server Error: The ‘DbProviderFactories’ section can only appear once per file.

You ever get the error:

The ‘DbProviderFactories’ section can only appear once per file.

…after a fresh install of Microsoft SQL Server Express?

DbProviderFactores error

When trying to do something like create a new table with SQL Server Management Studio?

New Table

I don’t know why, but one (or more) of the many maching.config files on your computer does, indeed, have TWO DbProviderFactories sections in it.  TWO of my machine.config files were like that, but the one causing this error was the one located here:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

TWO DbProviderFactores

[GARD]

I recommend doing a system wide search for all machine.config files that have <DbProviderFactories/> in them.  Open each one to see if it additionally has another DbProviderFactories section and delete the blank one.  Deleting it from the file mentioned above solved this problem for me.

NOTE!  You’ll have to open your text editor as Administrator or you’ll be forbidden from saving changes to the file(s)!

See these images?

image

You’ll find an actual working versions of them at the top and bottom of this article. Please click the appropriate buttons in it to let your friends know about this article.

Check back later for updates too!

Subversion 403 forbidden error

Are you getting a “403 forbidden” error when trying to create a folder or check code into subversion, but you can browse the repo?

[GARD]

There are many causes for this, but one of them that’s very difficult to find is caused by the casing of the URL.  When you check out from subversion, you can use any casing.  When you check IN, you’d better be using the ExAcT casing.  And don’t think that just because you’re using a GUI like TortoiseSVN that it does it for you.  IT DOES NOT!

See these images?

image

You’ll find an actual working versions of them at the top and bottom of this article. Please click the appropriate buttons in it to let your friends know about this article.

Check back later for updates too!

RegAsm.exe “failed to load” “because it is not a valid .net assembly”

Problem

Ever get this error when trying to register a .Net DLL as an ActiveX component using RegAsm.exe?

“failed to load MyAssembly.dll because it is not a valid .net assembly”

I’ll bet you’re using a version of .Net higher than 2.0, aren’t you?  Turns out, each version of .Net you have installed has it’s own, version specific version of RegAsm.exe and when you run the RegAsm.exe command for your .Net 4.0 or so DLL, it’s running the .Net 2.0 version of RegAsm.exe.

Windows Registry Forensics
Windows Registry Forensics

Why make an ActiveX control if you’re using .Net?  Sometimes you just have to for many reasons which are outside the scope of this article.

Solution

[GARD]

There are a couple of ways to resolve this.

Specify Specific Version

If you want to specifically state which version to run, make a batch file for each version and name the batch file appropriately, and have that batch file have the hard path to the right RegAsm.exe.  For example, for the .Net 4.0 version of RegAsm, I created a batch file called RegAsm_4_0.bat and put it in the same folder with the RegAsm.exe file for .Net 4.0 here:

C:\Windows\Microsoft.NET\Framework\v4.0.30319

The contents of my RegAsm_4_0.bat file looks like this:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe %1 %2

Now, from any Visual Studio command prompt (regardless of what folder I’m in), I type RegAsm_4_0 (plus my parameters) and it’ll run it.

Override default version

If, on the other hand, you want to continue using the command RegAsm, you can create a batch file named RegAsm.bat and put it in each of the framework folders.  All copies of those batch files should run the same, explicit version of RegAsm.exe you want.

Unfortunately, you can’t simply rename the RegAsm.exe files without messing around with security settings.  But that’s an option too which I’m not getting into here.

See these images?

image

You’ll find an actual working versions of them at the top and bottom of this article. Please click the appropriate buttons in it to let your friends know about this article.

Check back later for updates too!