A Blog by Scott Isaacs

Tag: Tools Page 1 of 3

NuGet and Lowering .NET Framework Version

Background

Today I was about to deploy an app to the server when I realized I had been building against .NET 4.5 while the server only had .NET 4.0 on it.  

Not a big deal, right?  I just needed to change the “Target Framework” in the project properties.  So I did, and it wouldn’t build.  Turns out I had some NuGet references that were targetting .NET 4.5.

Again, no big deal.  Remove EF 5.0 and add EF 4.4 (which is conspicuously named EF 5).  My build succeeds and gets deployed to the development server.

But it won’t run.  I dig around and find other NuGet references (specifically, Newtonsoft.Json) that also are targetting the wrong framework version.  I uninstall and re-install it (and Web API Client and HttpClient).

The Error

But at this point, my solution doesn’t even build.  I kept getting an error message:

‘System.Net.Http.HttpContent’ does not contain a definition for ‘ReadAsAsync’ and no extension method ‘ReadAsAsync’ accepting a first argument of type ‘System.Net.Http.HttpContent’ could be found (are you missing a using directive or an assembly reference?)

But I have a reference to System.Net.Http.Formatting where that extension method is defined.  In fact, when I use Visual Studio’s Go To Definition function, it takes me right to the definition.  At this point I’m perplexed.  So I do what any other developer would do.  Repeatedly remove and re-add the NuGet references, trying to figure out why it won’t build.

The Fix

All in all, I probably wasted almost three hours on this today before I found the fix.  I had to comment out the line of code that had errors and build the solution.  Once I had a solution that successfully built, I uncommented the line and the solution built successfully.

I don’t know why this fixed the issue.  I could spend more time trying to figure out why, but frankly, at this point, I don’t care.  I’m just glad I got my app deployed to the dev and test servers today and that I finally get to work on the project I planned to start last week.

Event Timer – Windows Store App

Update 5/4/2013: Source code now available on GitHub.  

Download Event Timer from the Windows Store I just spent a couple hours writing a Windows Store application for use at our Deeper in .NET conference this weekend.  It’s a simple app that displays the time remaining until the next session starts, and also allows you to cycle through slides (image files only) during the countdown.  Event Timer was initially published on 4/4/13.  You can find it and screenshots in the Windows Store.  For now, and for the foreseeable future, it will be free.

I already know of a few feature improvements I’d like to add to a future release, such as:

  • Moving the controls to an app bar (done, you can now view the controls by right-clicking or swiping from the top edge)
  • Adding some configuration options that persist, such as default slide interval and foreground/background colors.
  • I have some other ideas for subsequent releases as well, but will hold off on thinking too much about those to see if anyone else asks.  Why waste my time on something no one wants, right?

If you use Windows 8 or Windows RT, please give it a try and let me know what you think.  I’d be interested in any feedback.  However, since this is a free app, support will be limited and may be slow.  While no guarantees are made about this software, I have recently used it at a large developer event in Milwaukee.  I had zero issues and actually had several attendees compliment the app.

If you are a developer and are interested in seeing the very simple source code, you can find it on GitHub. Remember, I only spent a couple hours on the initial version for my own use, so be kind.  ðŸ™‚

Meeting Cost Calculator

Main Screen - After RunHave you ever been in one of those meetings where it seems that everyone in the company is there, even though they don’t need to be?  I think everyone has and it is especially frustrating when you are one of the ones that doesn’t really need to be there.

Well, based on a web site I saw a few weeks ago (the link escapes me at the moment), I wrote a little Windows Mobile app that will calculate just how much any given meeting is costing you and your clients.

It’s a pretty simple application.  You press Start, the dollars add up.  You press Stop, and they stop adding up.  You can specify the number of attendees at any given meeting.  You can also specify the default estimated billing rate and estimated cost to your company (for example, estimated average wage + benefits).

You can toggle back and forth between the client cost and the cost to your own company by either clicking on the appropriate region (current is highlighted) or by using the context menu on the Total Cost.  You can also reset the calculator from the context menu of the Total Cost.

Here are a few more screenshots.

Main Screen - After Reset Configuration Screen  Main Screen - Context Menu

You can download this directly to your Windows Mobile phone by going to one of the following links:

I am running WM6 with a touch screen, but it should work on WM5 and later.  I have only tested this on my phone, so your mileage may vary.  Download and run at your own risk.  Feel free to report any issues, comments or suggestions via the contact form below.

Update 1: This program requires the Microsoft .NET Compact Framework version 3.5.

Update 2: I’ve uploaded a new version with the following changes:

  • FIXED: Bug in highlighting currently selected cost
  • FIXED: Bug that always shows total for default number of attendees instead of currently selected number of attendees
  • CHANGED: Continues to run even if device is put into suspended mode
  • CHANGED: Configuration screen allows for higher ($500/hour) and more precise ($5 increments) for cost fields

Twikini – Windows Mobile Twitter Client

Twikini - click for larger sizeI have an HTC Windows Mobile phone (touch screen + keyboard).  For the last several weeks, I’ve been using a trial version of Twikini to access my Twitter stream.

I really got to like it.  There are a few things I’d like improved.  For example, on refresh it seems to have to get the whole stream and reload it rather than just getting updates since the last request.  Also, it does a timeline refresh after I tweet instead of just adding mine to the list on the client side.  But aside from those couple of performance things, it’s pretty slick and simple.

I liked it enough to be really disappointed when it expired and I remembered it was a trial version of non-free software.  It’s cost is reasonable at about $5, but they also have an option where I can get a licensed copy of the program by blogging about it.

So that’s what I’m doing here.  I like it.  I recommend it.  If you have a Windows Mobile phone and use Twitter, you should give it a shot.

Testing PreCode

I’m using this post to test PreCode — a code snippet formatting plugin for Windows Live Writer.  It uses SyntaxHighlighter on the client side and this plugin just sends the needed code to my blog engine.

As a test I thought I’d just add a couple short snippets, using some of the different available options.

//C#, using PREbool b = true;

' VB, using PRE, Starting at line #20Dim i as Int32i = 1i += 3MessageBox.Show(i)

Note that I may update this post several times while trying different options, or I may delete it altogether if I decide I don’t want to bother with the plugin.  (I think if I do delete it, it will be the only post I ever deleted.)

I would appreciate it if you would take a look at this post both in your RSS reader as well as on my website in your browser of choice and let me know what you think, my dear guinea pigs.

TimeSnapper

I’ve been using the free version of TimeSnapper off and on for some time now, but pretty regularly over the last few weeks since I started my new job.  I’m doing billable work again, and am notoriously bad at getting my time entered.  TimeSnapper helps by taking screenshots at some interval throughout the day and allowing me to play them back like a movie.

I’ve been thinking about getting the Pro version for a couple weeks because there are a few more features that could be helpful.  It’s an inexpensive program at about $40 (USD), but I just hadn’t pulled the trigger and bought it.  Then today on Twitter I saw that it was on sale.  It was actually on sale for $20.  Since I was on the fence at $40, I couldn’t pass it up at $20.

If you are like me and have a hard time keeping track of what you worked on, I highly recommend you check it out.  I still haven’t taken advantage of the Pro features, but even the free functionality is worth $20.

VS2008 DVDs From InstallFest

If you attended a VS2008 InstallFest in the last couple months and registered your trial copy of VS2008, you have probably received the final media in the mail in the last day or two (or probably will in the next day or two).  Someone sent me a note today asking about activated the installed trial version with the "real" software key.  He (and I) thought that it would be done from within the VS2008 IDE.

We were wrong.  In case anyone else is missing it like we were, this tip is for you.  You have to actually run the installer on the new disc.  Choose the option to "modify or uninstall" and after the installer finally loads, click next and you’ll see a handful of choices, including one to add a license key.  Copy the key from the disc jacket and you’re all set.

New Tool: Folder Finder

I’m on a roll here with the little utilities…

My dad called the other day as he was leaving his office (in California).  Due to the nature of his business and the way their network is setup, he and his team work with a large number of folders on a network share.  Each of these folders contains information about a particular project or potential project, and they are all contained within a single parent folder.  For example, the parent folder might be P:\Projects, and there may be hundreds of project folders such as P:\Projects\Project 023A, P:\Projects\Project 023B.  I don’t really know the names of the folders (I just made those up), but the names mean something to him and his team.

At any given time, though, there could be a couple hundred folders in the project folder.  Some come and some go, but overall the number seems to be increasing.  So it is getting harder for them to find the necessary folder when they need to do some work or reporting for that project.

FolderFinderNow, I can imagine that there is plenty of room to engineer some system (or buy something) that will help them better manage this, but what he really needed right away was a faster way to find a folder.  So I wrote Folder Finder.

It’s a very simple app to use and I only spent a couple hours on it.  Basically, you download the app and place it anywhere you want (.NET 2.0 required).  You run it and choose a base folder, which gets saved and re-used each time you run the app (C:\Projects in my example).  Then you just start typing a portion of the folder name.  Since the names mean something to you, just type the part you know.  It doesn’t matter if it is the beginning, middle or end of the folder name.  The list filters automatically.  At anytime you can double click your folder to open it, or if it is the first in the list you can simply press Enter.

That’s it.  All there is to it.  It doesn’t do anything super high-tech or magical.  It just lets them find their folders faster.

So if you want to download and use it, feel free.  As always, use it at your own risk, but I’d appreciate it if you’d let me know if you use it — especially if you have any comments or suggestions.  Also, feel free to share it with anyone who might think it is useful.  If anyone wants the source for any reason, let me know and I’ll make it available.

New Tool: App Dashboard

Many times I find myself with way too many files, folders and shortcuts on the desktop for things that I am currently working on and/or testing.  That’s in addition, of course, to the things I have on the desktop because I use them all the time.  Because of the way I’ve grown to work over the last several years, having an overly cluttered desktop makes me inefficient.  In fact, I’ve found that I need to have certain types of icons in certain places, and “empty space” on the desktop in certain other places.

AppDashboard Yesterday, I found myself with too many shortcuts on the desktop, all related to my current project at work.  So I wrote a little utility that I called App Dashboard.  Basically, it’s a series of buttons that launch the applications I previously had a bunch of shortcuts for.  Initially, the paths were hardcoded, but I quickly changed my mind and allowed them to be user defined.  Then I decided that rather than define them in a config file of some sort, to actually create a document type for these groups of applications.

Thus was born App Dashboard.  You can download the binaries and/or the source below (usual disclaimer stuff here — use at your own risk, etc.).

Now I’m a big fan of SlickRun, so you’d think I’d just add MagicWords for these things, but the items I use App Dashboard for are more likely to fall into one of two categories:

  • They are temporal, and will only require quick access for a limited time, and I don’t feel that is worth adding them to SlickRun (just my personal opinion — take it or leave it).
  • They are items that I use a lot, and clicking a button is easier than typing a command when my hand is already on the mouse.  Actually, many of these things have MagicWords already, but switching from mouse to keyboard is a pain.  (It’s the little things…)

However, since App Dashboard has its own document type, I can easily create a MagicWord to open this dashboard or that dashboard.  I see myself using them both in various combinations.

Additionally, I’ve included some basic functionality for associating a file type with the app and for using an identifiable icon for the dashboard group files.  It’s optional, but you can run the install.bat file to setup these file type associations.  The application will work fine without running that, but installing will allow you to simply double click on a *.adsh file to open that dashboard.

Anyway, I welcome any comments or suggestions.  I don’t claim this to be a model example of how to accomplish any particular task.  I only claim that it may help you as it has helped me to keep myself and my computer slightly more organized and efficient.  If not, just delete it.  (Note that if you did run the install.bat file, I recommend you run uninstall.bat before deleting to remove the file type associations.  No need to leave that hanging around in Windows if you decide to not use App Dashboard.)

Database Publishing Wizard

I don’t think I’ve written about this tool yet, but it’s one of my favorites.

Microsoft has release (on Codeplex) a SQL Server Hosting Toolkit (it’s free).  The entire toolkit is, I’m sure, full of goodness, but there is one part in particular that I really get a lot of use out of it.  I just shared it with Gerry to help him get his blog back up and running (finally), so I thought I’d post about it here.

The part that I’m in love with is the Database Publishing Wizard (download).  As the name implies, it’s a wizard and it will script out all or part of a database to a SQL file.  If your SQL Server host has installed the corresponding server-side bits, you can publish the database right to your remote DB instead of to file, but I personally like exporting to file.

Anyway, on the first screen you specify a connection to a SQL Server database server (2000 or 2005).  Then you step through a few screens and specify other options, such as which catalog to connect to, which tables to script, the target database version (2000 or 2008), and decide if you want to script the schema, data or both.  Then you “Hit Go” and a moment later you have a single .SQL file, suitable for executing in Query Analyzer, or whatever it is that they call the 2005 version of that.

I’ve used it for backing up a database at a particular point in time, so that, for example, I can revert to a version of the database that matches a particular version of my source (from VSS).  It’s also very handy for moving a database from one server to another, such as what Gerry needed to do.

I can think of a number of things that could be neat features to add, but it could easily get bloated unnecessarily.  So, with that in mind, there are only a couple things that I would like to see changed/added in this app:

  1. Ability to save my settings to a “project file” of sorts.  Perhaps, .DBPPROJ?  I’d rather not have to type in my server name, connection info, and script preferences each time.
  2. I’d prefer the default name for the generated script to be something along the lines of SERVERNAME_CATALOG_yyyymmdd.sql

Those aren’t that big of a deal, really, but I think it would be a relatively small investment on the part of the team that made this thing, and those features could save me minutes of time over the course of a week.  🙂

So if you’re a developer working with SQL Server databases, I’d definitely recommend checking out this piece of free software.

Page 1 of 3

Powered by WordPress & Theme by Anders Norén