Saturday, March 2, 2013

View source HTML in Google Chrome with the view-source: trick.

At the URL bar in Google Chrome type view-source: in front of the URL you are at to see the source HTML!

Friday, March 1, 2013

How to REALLY read from App.Config in a C# unit test project.

I have never been able to get this to work when revisiting it. I can't tell what I was thinking. Whatever. Here is the real way to do this and it is very easy:

using System.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject
{
   [TestClass]
   public class UnitTest
   {
      [TestMethod]
      public void TestMethod()
      {
         AppSettingsReader appSettingsReader = new AppSettingsReader();
         string baz = (string)appSettingsReader.GetValue("foo", typeof (string));
         Assert.AreEqual(baz, "bar");
      }
   }
}

 
 

Again: The build action on the App.config file needs to be "Content" and the "Copy to Output Directory" setting needs to be "Copy if newer." More: App.config should be configured as you might expect to accomodate appSettings. Mine looks like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
   <appSettings>
      <add key="foo" value="bar" />
   </appSettings>
</configuration>

the Report Builder button in SSRS

Reporting Services Scripter is a tool which allows you to slurp down SSRS reports from one server in some manner of serialized form and then shove them up to another server allowing for dev-to-UAT-to-production sorts of pushing and consistency. "But isn't that a bad idea?" you ask. "Why wouldn't you just push to either environment from a BIDS project you keep saved in TFS? Duh." Great point. That is the better way to go. The thing that breaks that model is "Report Builder" a button which may be turned on at an SSRS server interface to allow persons to roll their own reports right at the server outside of BIDS. Once you open this can of bad, you need a strategy to deal with it!

URL Rewrite

URL Rewrite is an IIS tool (module) that will allow you to do the sorts of things you do with ISAPI/rewrite/2 I suspect.

install services from Visual Studio Command Prompt

This sort of suggests that one would install a service (console app) at a server via Visual Studio Command Prompt (2010) for C# 4.0 stuff, and following this blog posting I installed Visual Studio 2010 on a server where I was not allowed to do so today. I am rolling back the install now. I was instead told to make an installer for the console app I need to deploy. It seems this is fairly common for console apps in ASP.NET. I just need to get on the other side of the learning curve. If I had used Visual Studio Command Prompt (2010), I would have run this command:

installutil yourproject.exe

 
 

To uninstall the same thing, I would use this command:

installutil /u yourproject.exe

Listen to your voicemail greeting or change it on an iPhone.

Go to the phone. Then go to "Voicemail" at the lower right where you would otherwise listen to your messages. When you get there there will be a "Greeting" button at the upper left.

Make someone an administrator in Windows Server 2008 R2.

The following is like this yet different:

  1. right-click on "My Computer" or the comparable icon and pick "Manage"
  2. at the Computer Manager pane that appears navigate to: Configuration > Local Users and Groups > Groups
  3. right-click on the "Administrators" group and select "Add to Group..." from the menu which appears
  4. add individuals here at the "Administrators Properties" window which pops up