I think, therefore I Code...

Wednesday, July 01, 2009

Window Remote Desktop Connection – Windows Server 2008 - Encountering a Black Screen after logging in

I had to Remote Desktop into a Windows Server 2008 machine for a client today and encountered a Black Screen after successfully logging in. No matter what I did, I couldn’t get the screen to go away. I tried all my normal tricks such as spamming ctrl+alt+delete and yelling at the screen, but nothing seemed to work. The next step was to Google it…

The Google results were plentiful and recommended that I disable Bitmap Caching from the Experience tab of the Remote Desktop Connection window. I do so and re-connected. No luck for me, but many others reported that this fixed it for them.

The next most common Google result was to check firewall, router MTU, and other router settings. Since my remote desktop connection have never had trouble before and I was able to successfully log into the same machine under a different user name, I figured I’d skip that one.

My next idea was to try and log in with another account. I logged in with the administrator account and found that it was working fine. My immediate thought was to try to find my other logged in session and force a log out. Supposedly, you can view logged on user by opening your  Server Manager, expanding File Services, clicking on Share and Storage Management, and then clicking on Manage Sessions in the action pane to the right. This did not work for me (my other session wasn’t listed,) but it might for you. =)

After trying all of these “fixes” I decided to just do what I needed to do from the Administrator account that I was logged onto. By the time I was finished, I switched back to my other Remote Desktop Connection screen and was surprised to see that it was no longer black, but was showing the login window again. The session must have timed out and locked. I logged in and everything seemed to be working correctly again.

I’m not sure if allowing the session to time out and lock was what fixed it or if Remote Desktop just needed some extra time… But hopefully something in this post helps you out if you encounter a Black Screen after logging into a Remote Desktop session.

~ Paul

Wednesday, May 27, 2009

IIS7 Error/Gotcha – web.config - ‘The configuration section 'connectionStrings' cannot be read because it is missing a section declaration’

I spent the better part of this morning trying to figure out what was wrong with a 3rd party blogging utility that we recently started using. I was getting and error message stating that “The configuration section 'connectionStrings' cannot be read because it is missing a section declaration” when setting up my development environment.

The ONLY reference to this error that I could find was from MSDN HERE. No sections of the web.config were encrypted so, none of the recommended causes and resolutions helped.The web.config file for the 3rd party project was pretty large and I thought it might have been due to mal-formed xml somewhere. I validated the xml and scanned for anything obvious, but it all looked like everything was fine.

I eventually tracked down the problem with the web.config file. The problem was in the <configSections> section of the web.config. The 1st line within this section was <clear/>. The <clear/> tag can be used to removes all sections and section groups that were already defined (either earlier in the given configuration file or higher in the configuration hierarchy.) This is helpful in other sections when you want to clear a default provider before registering a new one, etc…

It looks like <clear/> is a valid tag for this section, so I’m not sure why it would be causing the error. Either way it solved my problem for my development environment. Hope this helps someone else in the future.

~ Paul

Tuesday, May 26, 2009

Google Chrome, Bookmarks, Del.icio.us, and YOU! (aka Import your delicious bookmarks into Google/Chrome.)

So, like many of you, I’ve finally switched to Google Chrome as my web browser of choice (It has finally reached Default Browser status.) I still use Firefox for web development since Chrome lacks a lot of the tools I use day-to-day (Thanks firebug,) but the speed and usability of Chrome finally won me over.

Other than my development tools, the only other Add-on that I really miss is my trusty Del.icio.us Bookmark bar. It is great to have immediate access to my bookmarks in Firefox with tag support. To help remedy this situation I started to look at what options I have for accessing my Del.icio.us bookmarks from Chrome. You can do the obvious and just access them from http://delicious.com/, but that’s boring.

The 2nd option is to use bookmarklets. You can add these to any browser and they are basically bookmarks that give you access to your bookmarks. Not as good as a direct bookmark bar, but better than browsing there yourself 100 times a day. You can even get delicious bookmarklets that make it easy to pop-up the “Save bookmark” screen for the current page you’re on to add new bookmarks. For more information on adding delicious bookmarklets, click HERE.

The 3rd option (and the one I’m actually trying out.) Convert to Google Bookmarks. Unlike delicious, google bookmarks keeps your bookmarks private and makes them and their contents searchable. You can manage your bookmarks from the site or using Google toolbar. You can also manage them in Firefox using Add-ons. For users of iGoogle (Google’s home/startup pages), you can also get a Google Bookmarks Gadget that lets you interact with your bookmarks.

The next question is how to get ALL of your precious bookmarks out of Del.icio.us and into Google Bookmarks. Well, that’s easier than you might think. Mihai Parparita from Google has created a script that will import all of your Delicious bookmarks into Google Bookmarks automatically. You can perform the import HERE or read-up about it HERE.

You can also add bookmarklets for the Google Bookmarks service if that’s more to your liking. Check it out at HERE.

Does anyone else have a better solution for managing and accessing your bookmarks from Chrome?

~ Paul

Monday, December 22, 2008

ASP.Net asp:ListBox - No Selected Items - Selected = False - Databinding (item.Select = false for all items) (SelectionMode = Singe/Multiple)

If you are working with a Data Bound ASP.Net ListBox control (or a similar control) and are having trouble with all of your ListItem.Selected calls are returning false even though you KNOW you selected one or more of them. You might have an issue with the way you're Data Binding.

Consider the following code. In my example I am using a DataBindControls method that will retrieve some data and then bind it to a ListBox.

private void DataBindControls() {
ArrayList roles = RoleProvider.Instance().GetRoles();

lbRoles.DataSource = roles;
lbRoles.DataTextField = "RoleName";
lbRoles.DataValueField = "RoleId";
lbRoles.DataBind();
}

I just so happen to be calling this method in the Page_Load even of my page. Unfortunately, I forgot to wrap this call in a "IsPostBack" check. What is happening is that my control is being databound again before I access the selected values from the previous request.

protected void Page_Load(object sender, EventArgs e) {
DataBindControls();
}

You can easily remedy this issue by wrapping the call in an if statement that makes sure to only databind your controls on the initial call to the page. (when it's not a post back)

protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
DataBindControls();
}
}

Just another one of those "Palm to Forhead" issues. Hope it helps someone. =)

Tuesday, October 14, 2008

Empty div with background-image style and set height has extra white space after - Internet Explorer 6 (IE6) CSS compatibility

I was trying to fix a small display issue with one of our pages in IE6. I had an unordered list that we set the background color on and wanted to add rounded images to the top and bottom to give it a nice look.

The rounded top image

storesubnav-selected-top

The HTML

<div class="container">
<
div style="height: 6px; width: 190px; background-image: url(../images/top.gif); background-repeat: no-repeat;">
</
div>
<
ul style="background-color:#763000;">
<
li><a href="#">Item 1</a></li>
<
li><a href="#">Item 2</a></li>
<
li><a href="#">Item 3</a></li>
</
ul>
<
div style="height: 6px; width: 190px; background-image: url(../images/bottom.gif); background-repeat: no-repeat;">
</
div>
</
div>

Simple enough. Everything works great in IE7, Firefox, Chrome, etc... I get a report of extra white space after the top rounded image. I track down a system running Windows XP with IE6 and I fire it up. Sure enough, a bit of white space after the top div. But why....

The Problem

With White Space

I tried everything that seemed to make sense. Checked margins, padding, etc... Everything was either good or changing it did nothing. Unfortunately in IE6 I didn't have access to my favorite tools like Firebug, so it was even more frustrating. Eventually I figured it out and I think I know what's going on.

IE6 assumes a font-size of 20px. Since my background-image was only 6px in height, when I set the height on the div it was ignored. The div would try to shrink to my set height, but would end up limited by the assumed font-size of 20px. By setting the font-size to something smaller in height than my desired 6px, it would solve the problem. Remember this when dealing with empty divs IE6. Hope it helps someone.

The HTML that works

By setting the font-size style in the "empty" div, IE6 allows the div to shrink to my desired height of 6px.

<div class="container">
<
div style="height: 6px; font-size:0em; width: 190px; background-image: url(../images/top.gif); background-repeat: no-repeat;">
</
div>
<
ul style="background-color:#763000;">
<
li><a href="#">Item 1</a></li>
<
li><a href="#">Item 2</a></li>
<
li><a href="#">Item 3</a></li>
</
ul>
<
div style="height: 6px; font-size:0em; width: 190px; background-image: url(../images/bottom.gif); background-repeat: no-repeat;">
</
div>
</
div>

Without White Space

Google Chrome shows saved passwords in plain text - Security Flaw

Google's new web browser "Chrome" is pretty nice. I used it for a full day and found quite a few things that I really liked about it. As soon as the few plug-ins that I use daily get equivalents in Chrome, I will possibly use it for every day use. I was sad to learn that one of my biggest web browser pet-peeves is present in Chrome, and it seems to be an even worse implementation of it than Firefox 3's (Firefox 3 Saved Password Security.)

The Saved Password feature of any browser can be invaluable. It saves a great deal of time for passwords that you would otherwise have to enter many times a day. Unfortunately, most web browser make it WAY too easy to gain access to the web site URL, username and plain-text passwords to your accounts. Someone with only a few minutes access to your machine can easily gain access to this information.

In Google's Chrome, all someone (with several seconds alone with your computer) needs to do to steal your information is...

  1. Open Chrome
  2. Click customize(the wrench)
  3. Select Option
  4. Click the Minor Tweaks tab
  5. Click Show saved passwords
  6. Select one of your "secure" sites
  7. Click Show password

Chrome

BAM! Someone just stole the web site address, username and password to one of your accounts? I hope it wasn't something important... In Firefox's defense, at least they have a "Master Password" that will require you to enter a password prior to them showing your passwords in plain-text. But no such feature is present in Chrome.

I'm always blown away by people's responses to this problem. People that I show in person are usually shocked when we're both staring at their bank account password in plain-text right before their eyes. People online usually say that no one ever has access to their computer, so their safe, or that they always lock their system when they're away. That's a great practice to get into, but I know the vast majority of users aren't so diligent.

At the very least, the Chrome team needs to add a master password for an added layer of security. I think both Firefox and Chrome should warn the user about this danger and prompt them to setup a master password by default, rather than having saved passwords turned on by default.

Tuesday, September 09, 2008

Adding Reporting Services to an existing MS SQL install and what to do if Reporting Services is Grayed Out.

You can add Reporting Services to an existing install of MS SQL in Windows Vista (not sure how different the step would be in XP) by following these steps.

  1. Open Programs and Features (press the windows key, type in Programs and Features and press enter)
  2. Right-Clicking on Microsoft SQL Server 2005  and click Change.
  3. Under SQL Server 2005 instances:  select the instance you want to add reporting services to and click Next
  4. Click on To install a new component, click here
  5. Browse to the Setup.exe file on your installation disk and click OK
  6. Click through the wizard until you get to the Components to Install screen
  7. Select Reporting Services  and finish the wizard.

It's that simple... Unless Reporting Services  happens to be Grayed Out. If this is the case for you, you are probably missing requirements that Reporting Services needs. During the above process, you came to a screen called System Configuration Check and you probably got a yellow exclamation point on IIS Feature Requirements. Basically, you need to add some features to your IIS installation before you can install reporting services.

 

To enable these IIS features, follow the steps below.

  1. Open Programs and Features (press the windows key, type in Programs and Features and press enter)
  2. Click on Turn Windows features on or off to bring up the Windows Features window
  3. Expand the Internet Information Services option and place check marks next to all the features you want to install
  4. Click OK to install the features.

Here is a list of features that are required before you can add Reporting Services to your existing MS SQL Server installation. (Reference here.)

Component Folder
Static Content Common HTTP Features
Default Document Common HTTP Features
HTTP Redirection Common HTTP Features
ASP.Net Application Development
ISAPI Extension Application Development
ISAPI Filters Application Development
Windows Authentication Security
IIS Metabase Management Tools
IIS 6 WMI Management Tools

 

After adding these features, try to perform the steps above for adding Reporting Services to an existing MS SQL Installation and Reporting Services should not be grayed out. Hope this helps.

Tuesday, August 19, 2008

Enable Disabled Recording Devices in Windows Vista

I had some strange sounds coming over my speakers and thought it might be one of my recording devices (my built in mic, etc) acting up. To troubleshoot this I brought up the Sound window, clicked on the Recording Tab and right-clicked on each of my recording devices to disable them. It turns out my problem was caused by something else and was easily fixed, but now I have a new issue. How to I enable my recording devices. If you check the Recording Tab in the Sound window, there are no devices listed. Maybe I can enable them directly from the Device Manager. Nope, nothing listed there either...

The solution is fairly simple, but seems to be completely non-standard for windows. Go back to the Recording Tab in the Sound window and right-click in the now blank tab. You should get a context menu that has two options (Show Disabled Devices and Show Disconnected Devices.) Click on Show Disabled Devices and you should now be able to see and enable your devices.

Not a huge issue, but fairly annoying since it is done differently than most other places in Windows (i.e. The network device screen. Disabled devices are still visible but are disabled...)

Slashdot This Post