Lance Larsen - .NET Architect Madison Wisconsin

Archive for March, 2013

So if you haven’t looked – in VisualStudio projects under the “Properties” folder – there is a file called “AssemblyInfo.cs” – it contains many useful assembly attributes for your project including AssemblyTitle, AssemblyCompany, AssemblyCopyright, AssemblyVersion, etc.

My goal was to make a simple and elegant static class to retrieve these values – on top of that wanted to be able to retrieve the values within another project ( class library ) from the calling project, ie. what is the AssemblyTitle that is calling this class library.  I was specifically doing this for logging purposes – wanting to capture the project and version.  Accomplished both as follows…

How to get the values…
.

   1:  string company = ApplicationInfo.Company;
   2:  string product = ApplicationInfo.Product;
   3:  string copyright = ApplicationInfo.Copyright;
   4:  string trademark = ApplicationInfo.Trademark;
   5:  string title = ApplicationInfo.Title;
   6:  string description = ApplicationInfo.Description;
   7:  string configuration = ApplicationInfo.Configuration;
   8:  string fileversion = ApplicationInfo.FileVersion;
   9:  Version version = ApplicationInfo.Version;
  10:  string versionFull = ApplicationInfo.VersionFull;
  11:  string versionMajor = ApplicationInfo.VersionMajor;
  12:  string versionMinor = ApplicationInfo.VersionMinor;
  13:  string versionBuild = ApplicationInfo.VersionBuild;
  14:  string versionRevision = ApplicationInfo.VersionRevision;

 

Read more


Quotes

Categories: Quotes
Comments: No
  • No battle plan survives first contact with the enemy. How you adjust to the unforeseen is what determines success. And how you choose who leads determines character. – Batman via Young Justice, derived historically from Helmuth von Moltke the Elder — find this to be analogous to development projects… :)

Been having a lot of fun with working on Windows Phone 8 apps – specifically using the LiveSDK to integrate to use SkyDrive.  Good examples with authenticating and getting the OAuth login window to pop-up for the user – but unless you want that to happen every time the user bring us your application – you need to take advantage of the InitalizeAsync() method in the fashion below.  Didn’t find many ( if any ) great examples of doing this – so when I pieced it all together – wanted to share with other WP8 developers. :)  Good Coding! Enjoy…

Read more


imageNeeded to use some controls that are available in the “Windows.Phone.Controls.Toolkit” for a Windows Phone 8 project in Visual Studio 2012 – and in the past was able to find said toolkit through by clicking “Tools” then “Extensions and Updates…” – then searching “Windows Phone Toolkit” – but even though I confirmed through other blogs that this used to be possible – I don’t see it.  

So wanted to let anyone else searching know that even though you don’t see in in the Nuget UI – you can still get it the alternate was as follows…

image1) Click “View” –> “Other Windows” –> “Package Manager Console” then enter “Install-Package WPtoolkit” – and it’s still there but in stealth mode from the Nuget UI.  :)

PM> Install-Package WPtoolkit
Successfully installed ‘WPtoolkit 4.2012.10.30′.
Successfully added ‘WPtoolkit 4.2012.10.30′ to SocialVoice.

2) Confirm that you see “Windows.Phone.Controls.Toolkit” in your References – and all is good with the world again!


So after one of the latest installs / updates I started having weird issues on my computer – some were just annoying, some were critical and didn’t allow for programs to even open – such as Visual Studio throwing the oh-so-helpful exception of “Exception has been thrown by the target of an invocation”… If that wasn’t clear – well what is?!?!

Here were other symptoms:

  • Unable start Visual Studio 2012, Visual Studio 2010 SP1 and SQL Server Management Studio 2012
  • Missing icons for Windows Explorer on the taskbar, icons for some of the other tools (Services, Event Viewer, etc.)
  • From the Command Prompt or when running batch files – XCopy and other commands stopped working.

Have you guessed the fix for this yet? No? Me neither… So I “Googled” it on BING and came up with the following nugget of… well I would say gold, but you all will soon know that I’m thinking it was a nugget of…

“A path environment variable cannot exceed 2048 characters”… say what? Really? Is this y2k’s revenge?

  Read more