Category Archives: Programming

How to fix stdole error with Visual Studio opening web pages

So I’ve hit an error the first time I open up a *html file in Visual Studio. You’ll see the following message if you’re in the same boat as me:

An exception has been encountered. This may be caused by an extension.

You can get more information by examining the file ‘C:\Users\<USERNAME>\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml’.

vs_dialog

You’ll see this line in the ActivityLog.xml:

System.IO.FileNotFoundException: Could not load file or assembly ‘stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified. File name: ‘stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ at Microsoft.VisualStudio.JavaScript.Web.Extensions.Interop.HTMLEditor.HTMLTreeHelperFactory.Create(ITextBuffer buffer) at Microsoft.VisualStudio.JavaScript.Web.Extensions.Interop.HTMLEditor.HTMLTreeHelperFactory.<>c__DisplayClass0_0.<GetOrCreate>b__0() at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func`1 creator) at Microsoft.VisualStudio.JavaScript.Web.Extensions.Interop.HTMLEditor.HTMLTreeHelperFactory.GetOrCreate(ITextBuffer buffer) at Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTagger..ctor(ITextView view, ITextBuffer sourceBuffer, ISPASupportedTagProvider tagNameProver) at Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.<>c__DisplayClass2_0`1.<CreateTagger>b__0() at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func`1 creator) at Microsoft.VisualStudio.JavaScript.Web.Extensions.Classification.SPARegionTaggerProvider.CreateTagger[T](ITextView textView, ITextBuffer buffer) at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

The emphasis on stdole is mine. You’ll probably go digging around for actual solutions. You’ll probably find┬áthe following when trying to dig up a solution:

Issue with TypeScript – Uninstall/Reinstall Tools and Windows SDK, then clear VS cache

as well as a few other solutions that I can’t seem to find in my history. No solution worked so far. Thankfully, I fixed it with the simplest solution (but not the best):

c:\>dir /s stdole.dll

I copied the one from here:

Directory of c:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies

07/07/2015 12:51 AM 32,416 stdole.dll
1 File(s) 32,416 bytes

to the folder where devenv.exe resides (usually C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE). I’m going to make a forum post later to get a non-hacky solution to the issue, but for now, this is what worked for me.

You don’t know what you have until it’s gone…

Oh man, I really haven’t posted on this blog for a while. But, I think I should start jotting down more development-related thoughts since there have been some big changes in my life, so here goes!

The biggest change that happened in the year I didn’t write a thing was getting laid off from Microsoft, which has probably been the best thing to happen. I joined a startup called PlaceFull shortly after I was able to be employed again, and within four months, I’ve learned a considerable amount. I’ll discuss a lot of these things at some point, but the biggest thing I’ve learned involved the attitude towards test automation and testers.

Having no test cases is a living hell. Having bad test cases is also a living hell, one that I was constantly subjected to at Microsoft. But I’d take bad test cases over none, because at least some worked.

I recently had to work on a redesign of our site, and delving into the deep parts of our front end has been torture. One of the changes was to rework how we handle our URL routing for SEO purposes, and that code is just a Jenga tower waiting to fall. Of course, I broke parts of our routing, but what made it painful was testing a fix and having to make sure I didn’t break any other part.

Of course, coming from a test background, in my side time I created a small test framework that tests from our front-end (shout out to Selenium!) and a test suite for this area. There’s so much more work to do though. So many areas of the site have been broken for who knows how long, and I’m getting sick of it.

Now, if anyone complains about or tries to devalue tests, I think I need to yell at them. Once you experience a world where you’re doing your testing manually, you’ll come running back. It may be hard to create great, stable tests, but you’ll still have your sanity at the end of the day.

Fun with Unity GUI Controls

In preparation for some serious game coding in the new year with code jams, OGAM, and hopefully more, I’m creating a template for all my Unity games. I really don’t want to deal with creating a title screen, menus, and all that jazz, so I’m preparing this now. It’s actually somewhat easy once you start reading everyone’s solutions to problems, so I’ll consolidate some of those resources here. By the way, if you want to check out the template, it’s located at https://github.com/monkeysSuck/BaseUnityProject.

Controller Input and Menus

The element you’ll probably be rushing to use to create a GUI is the standard button (GUI.Button). However, there’s a much better object to use: GUI.SelectionGrid. With this, you can consolidate input methods as well:

public const float fMaxJoystickRange = 0.8f; // Joystick range for detecting input

void Update() {
	if (Input.GetButtonUp("Up") || 
            Input.GetAxis("Vertical") < -fMaxJoystickRange)
        {
            iSelected = Mathf.Max(iSelected - 1, 0); 	
        } 
        else if (Input.GetButtonUp("Down") || 
                 Input.GetAxis("Vertical") > fMaxJoystickRange)
        {
            iSelected = Mathf.Min(iSelected + 1, 
                            arrButtonNames.Length - 1);
	} 
        else if (Input.GetButtonUp("Select") || 
                 (GUI.changed && Input.GetMouseButtonUp(0)) || 
                 Input.GetButtonUp("Select (Controller)"))
        {
            ProcessInput();
	}
}

The best part about this? It handles mouse, keyboard, and controller. All of these inputs are set via InputManager. For the mouse input, I do an additional check for GUI.changed because we want to avoid clicks outside of the GUI.

Pausing the game

Pausing the game is also quite easy. Adding a small script that gets added/removed when a button is pushed. In this script, when the script is initialized, store the old Time.timeSpan value and set Time.timeSpan to 0. Then, in the script’s OnDestroy method, reset Time.timeSpan to the stored value.