Tech Talk A software developer on all things tech, and then some

15Apr/140

Exception was thrown by the target of an invocation – Visual Studio 2010 | 2012

EnviroVar

After installing some recent updates to some visual studio extensions and features, I started getting the following error when I was trying to start up Visual Studio 2010 or Visual Studio 2012.

"exception was thrown by the target of an invocation"

After Googling around for a little bit, I found a Stack Overflow article which described the issue. Apparently there is a max length to the Path System variable (I believe is 2048 characters), which if exceeded, will prevent a few different apps from functioning correctly, including Visual Studio 2010 and 2012. However, if you attempt to go to System, then to Advanced System Settings you will get another error because the path is too long.

"windows cannot find ' %windir% system32 systempropertiesadvanced.exe' "

So, to correct this the first time, follow these steps :

  1. Go to your system32 folder in your Windows Directory (Most likely will be C:\Windows\System32)
  2. Find and run the executable System was trying to find - systempropertiesadvanced.exe
  3. You should be on the Advanced tab. If you are not, go there. Click Environment Variables
  4. Under the System Variables group, find the Path variable. Click Edit
  5. Copy to notepad, or text editor application. Delete unnecessary entries
    1. Make Sure the following stays (It's Windows 7 default) - %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\Syst‌​em32\WindowsPowerShell\v1.0\;
  6.  Copy back to the Variable Value, hit ok through all the dialogs, and you will be good to go!

* Please note you won't see icons back for folders, etc... until Explorer is restarted. You will be able to open up Visual Studio right away again however.

25Mar/140

Creating a Custom Microsoft Management Console

There have been a few times I've needed to access the event viewer, local users, etc... on a server and the options are not easy to find (Windows Server 2003), but this will work for almost all Windows Operating Systems. What's cool about MMC, you can set up on your local machine and point Snap-ins to other machines (servers, etc...)

Instructions

Go to Run (or start) and type mmc

Go to File  -> Add/Remove Snap-in...

File-AddRemove

Hit Add to bring up a list of snap-in components

Add-Snapin

Select the Snap-in, or Folder for organization, and click add

Add-Option

For select components, select either local computer (if you are adding on say, a server) or add the server name if you are adding from local machine to monitor a server

ComputerSelect

Hit File -> Save As and save to the desired location. There you have it, a custom MMC console!

Sources :

http://technet.microsoft.com/en-us/library/bb742441.aspx 

12Mar/140

Dawn

ApplicationIconTileImage_310x310

Description
Dawn is a morning assistant app which will display the meetings for the day, as well as display basic weather and traffic conditions in your area to know how that drive into work will be. You can also set up reminders to launch the application on a scheduled basis in the morning, which will also start a text to speech version of all the information. (Perfect for driving to work and playing over the radio)

 
 
 

This slideshow requires JavaScript.

Feature Summary :
- Displays the current high. low, and weather conditions in your area
- Displays the amount of time and distance to your work
- Displays all your meetings for the next 24 hours.
- Set up reminders for weekdays, Saturday, and Sunday
- Allows you to use the TTS function anytime

Version 1.0.2.0
- Add option for male or female voice
- Add a news rss feed
- Minor bug fixes

Version 1.0.0.2
- Low/High Weather Fix
- Stability improvements
- Lowered refresh time (down from 24hrs)
- Fixed blank meeting titles

462x120_WPS_Download_cyan

5Feb/140

GnuPG Encryption / Decryption in SSIS 2012

GnuPG (GNU Privacy Guard) is a free implementation of the OpenPGP standard as defined by RFC4880, not to be confused with the proprietary PGP (Pretty Good Privacy) version originally created by Phil Zimmermann. When needing a quick, easy, and free solution to encrypt and decrypt OpenPGP standard files in a SSIS package, GnuPG was the way to go.

Note to Advanced Users : All I am pretty much doing is creating a Execute Process Task, pointing to the GnuPG executable and passing some dynamic cmd args. If you are unaware of this process, read on!

21Nov/130

Exec sp_help on a table with a schema

Really quick post regarding sp_help and tables in Schemas (not in dbo). Usually when doing a sp_help, you can do something resembling the following :

EXEC sp_help TableName

However, if you try to do the same with a table with a Schema (SomeSchema.TableName) you will get an error "Incorrect syntax near '.'". To execute the sp_help on a table with a schema, simply surround the desired table and schema with single quotes.

EXEC sp_help 'SomeSchema.TableName'

That's all there is to it.

Tagged as: , No Comments
29Oct/130

Reverting To Chrome’s Old New Tab Functionality

New-NewTab

I am not a huge fan of Google's new, new tab page. While it might be easier or quicker to search for people who are new Google's browser, it started becoming a pain for somebody who is used to using many chrome apps and used to searching straight from the address bar. Doing so is quite quick and painless, just involving tweaking a single setting in Chrome. See below for the full steps.

Steps

  1. Type, or copy and paste, into the address bar : chrome://flags/#enable-instant-extended-api
  2.  Select Disabled under Enable Instant Extended API
  3. Hit the button that appears at the bottom of the page "Relaunch now"
  4. Hit ctrl + t and enjoy your old new tab functionality back.

 

*Update 2/28/2014*

**Looks the ability to disable the "Apps" functionality was removed 2/20/2014.   Will let you guys know if I find a new way around!

 

11Oct/130

MondoText

MondoText

I was in need of a tool to quickly format text for SQL and other various development applications, so I decided to write something light weight and to the point. MondoText, named for large text editing, can remove duplicates, change case, add output delimiters, and even add text qualifiers. Some of the features listed below :

  • Remove Duplicates
  • Remove Blank Lines, text
  • Replace single quotes with double quotes
  • Escapes quotes and tick marks
  • Encode/decode html markup
  • Lower / Upper case
  • Add quotes or ticks to text
  • Add delimiters to output
    • Vertical
    • Horizontal
    • Comma
    • Pipe
  • Find & Replace

MondoText-Sample2

You can download it here for free! ( zip | 7z | exe)

Also, for more downloads visit my Downloads Page!

13Aug/132

Command Prompt (CMD) Doesn’t Change Directories

When working with command prompt, to change directories you usually do something like the following :

cd [FilePath]

I was using the above method to try and change directories to a different drive (ie c:\ to f:\), and it wasn't working. After googling and reading Microsoft's documentation about CD, I realized I needed to just include the drive. When using CD, you are just changing the directories within the drive which CMD is currently looking in. So, to change the drive, just write the following :

[drive letter]:

Update : 10/14/2013
Chris in the comments below included a good point I forgot to mention, if you want to change the directory all in one line, you can do so with the following command

cd /d o:\test\test

For example :

To change from c:\ to o:\   (Without the quotes... Syntax highlighter hides the drive path if I don't include them)

"o:"

That's all you need!

24Jul/130

Quick Guide To Changing Your Local TFS Bindings

After recently getting a new, larger, secondary drive, I thought it was time to move my TFS folder to the new drive to free up some space. After doing some research on how to get started, I saw articles that were either made it too complicated or articles didn't quite list all the steps. So, I attempted to aggregate the information and give you a quick, simple way to move your bindings to a new location.

Step 1 : Open Up Your Workspaces

Workspaces

Select File -> Source Control -> Workspaces... This will bring up all the local workspaces that you have access to. Select the name of the workspace for which you need to change the location for and hit Edit...

EditWorkspace

You will then need to double click the binding which you need to change. For example above, I'd double click the C:\TFS\Main under Local Folders, then click the ellipsis which appears. Then select the new location where you want your local repository and that's all there is to it!

2Jul/130

Guide To Speeding Up Your PC (Windows)

We've all seen those horrible commercials about speeding up your PC, offering a one stop online solution to all your problems, blah blah blah. Just a heads up, most of the time these people are just making money by advertising, and will perform tasks you can do quickly and safely on your own, but charge money in the process. I have decided to give a free solution to those cheesy ads, and to help those who are willing to try and fix the issues themselves, and just didn't know how to get going. So, before you get started note two things. First, ALWAYS backup your data before attempting any updates/fixes to your computer, whether hardware or software related. Second, I am no way responsible for any damages caused by this article.

30Jun/130

Recover Deleted Files

It's happened to us all once or twice... You delete a few files, empty your bin, then think "O crap, I needed those files". Well the good new is there might be a chance to recover those selected files. All that really happens when you delete a file, picture, etc... is your operating system with remove any pointers to that data stored on your hard drive. This allows for your hard drive to overwrite this data again. If your hard drive is pretty big, or if you deleted the file not long ago, there is hope. There are programs made to go out to your hard drive and find data that had been deleted by your operating system. I recently tried out a few file recovery applications and thought I'd share for those who are in the situation described above.

Piriform's Recuva

image

Piriform's Recuva was quick to download and was nice and easy to go on my way to recover the files I needed back. The scans were quick, even for all items. Within seconds it listed all the files that were deleted recently from my computer.

Within the list of files, it will also tell you where it was deleted from, the last modified date (When you deleted it), and the state of the file. Over all I was impressed by it's ease of use and quick solution to the problem. For a person who just needs a quick application to try and recover a file or two, I would recommend this app for what you need.

PC Inspector

image (1)Next on the list is PC Inspector. Don't let the interface fool you too much. This is still very much capable of recovering those list files as the app above. The interface however is for the slightly advanced user.

For someone who just needs a quick way to recover some files, I wouldn't recommend this one for you.

Undelete Plus

image (2)

Undelete Plus was very similar to Recuva above. It quickly scanned the files I told it, describe its damage, and allow you to attempt to repair.

Again, for the user that needs to the quick file restored, this is another option for you.

Notes : For mac and linux, I would recommend CGO Scurity's PhotoRec. It will handle most of what you need if you are not on a windows operating system.

Overall Winner : If  I had to pick just one above, it would be Recuva. The app comes from the respected software vendor who created the CCleaner appliction. It's quick and accurate, and will get the job done.

5Jun/130

Member [MethodNamd] cannot be accessed with an instance reference; qualify it with a type name instead

Early in a work morning, debugging somebody else's old code, and without coffee, I get the following error message and got stumped for 2-3 min (Hate to admit with my experience) : Member [MethodNamd] cannot be accessed with an instance reference; qualify it with a type name instead. While this error message can be quite common when updating old code, it might not be obvious to those who are new to instance and static variable types.

Issue : The issue is that you have a static method declared in the class you are referencing, but calling it like an instance variable. (Declaring an instance of the class and calling the static method)

Resolve : Call the static method through the static name of the class, not the instance.

Example :

The following example shows the wrong way to call a static method ( What will throw that error message you are seeing), and the right way.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestShell
{
    class TestClass
    {
        public TestClass() { }

        public static void DoSomething() { }

        public string ReturnSomething()  { return string.Empty; }
    }

    class Program
    {
        static void Main(string[] args)
        {
            TestClass test = new TestClass();
            // Wrong
            test.DoSomething();
            // Right
            TestClass.DoSomething();
        }
    }
}

As I said, pretty easy problem to solve and won't take you long to fix. Hope this helps and happy coding!

Tagged as: , No Comments
%d bloggers like this: