Powershell is a powerful scripting shell to do any number of administrative tasks. Below is the introductory level presentation I gave to fwPASS, the Fort Wayne chapter of the Professional Association for SQL Server on 10/23/2012.
Sunday, April 7, 2013
Wednesday, June 20, 2012
Hyper-V Manager cannot connect–make sure RPC service is running
My Hyper-V Server 2008R2 lab environment is so stable I rarely fire up the Hyper-V MMC snap-in. The last time I opened it was four months ago when I switched from booting it from a USB stick to booting it from an IDE drive. I opened it today and it gave me the typical “Cannot connect to the RPC service on computer 'Servername'. Make sure your RPC service is running.” error. My quick troubleshooting steps follow:
- I double checked to make sure the IP address and host name were still specified in the \etc\hosts file. It was.
- I attempted to remote into the Hyper-V server directly using Remote Desktop and was met with the “Your password has expired” message. I reset the password, and voila – the Hyper-V manager MMC connected to my server and displayed the current state of my VM’s.
Tuesday, June 19, 2012
Blank Page when Publishing a Silverlight App
I just deployed a new Silverlight application to a Windows Server 2003 box as a new website and was surprised with a blank page when I launched the application. No error messages or warnings, just a completely blank page.
A quick web search and I realized I had been here before. You have to register the MIME types, .xaml and .xap, in IIS for the website. I added them for a previous website, but I didn’t add them at the server root.
Simple instructions to add the MIME types to IIS can be found on Jacqui’s Dev Blog under Deploying Silverlight Application - Why Blank?! Note the first blog post comment that suggests adding the additional .xap application/x-silverlight-app and .xbap application/x-ms-xbap MIME types. I didn’t need to add the .xbap to get my application working, but I did need the .xap.
Wednesday, June 6, 2012
Visual Studio Project – unavailable
I hadn’t opened a particular Visual Studio solution since getting a replacement workstation and rebuilding my developer environment. Upon opening, one of the projects in the solution would not open and showed up as “(unavailable)” as shown below.
The Output window displayed the not very useful message, “The project type is not supported by this installation.”
In order to find out why, I opened the LPM.csproj file using Wordpad, not in Visual Studio, and scanned through the properties looking for insight as to why the project was unsupported. It didn’t take long to find the issue.
This project was using MVC 3 and the Entity Framework 4.1 which were not installed on my new workstation. I installed EF 4.1 on my old workstation specifically so I could use the MvcScaffolding NUGET package with an existing database design for a product technology upgrade. See my previous posts detailing some of my experiences with MvcScaffolding and the ASP.NET MVC framework.
After installing both ASP.NET MVC 3 and EF 4.1, all the projects in the solution opened as expected. Another small victory!
photo credit: ruurmo / CC BY-SA 2.0
Tuesday, May 29, 2012
Sterling Serialization issue - Object of type 'System.Int32' cannot be converted to type 'System.DateTime'
I created a new data model class to store in a Sterling NoSQL database. On the first and all subsequent attempts to save or retrieve data of this type, I received the error message at the bottom of this post. A number of other people reported similar issues. Apparently it is some type of serialization/deserialization issue. I didn’t find a suggested resolution, but on a whim, moved the AssessmentDate DateTime property from the top of the list of properties in the class to the bottom and that seemed to resolve the issue.
Object of type 'System.Int32' cannot be converted to type 'System.DateTime'.
at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Wintellect.Sterling.Serialization.PropertyOrField.<get_Setter>b__0(Object obj, Object prop)
at Wintellect.Sterling.Serialization.SerializationHelper.<>c__DisplayClassd.<_CacheProperties>b__5(Object parent, Object property)
at Wintellect.Sterling.Serialization.SerializationHelper.Load(Type type, Object key, BinaryReader br, CycleCache cache)
at Wintellect.Sterling.Database.BaseDatabaseInstance.Load(Type type, Object key, CycleCache cache)
at Wintellect.Sterling.Database.BaseDatabaseInstance.Load(Type type, Object key)
at Wintellect.Sterling.Database.BaseDatabaseInstance.Load[T,TKey](TKey key)
at Wintellect.Sterling.Keys.TableKey`2.<.ctor>b__0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at LeanAssessmentNav.Views.Register.<BindLists>b__6(TableKey`2 a)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at LeanAssessmentNav.Views.Register.BindLists()
at LeanAssessmentNav.Views.Register..ctor()
photo credit: Le Petit Poulailler / CC BY 2.0
Why isn’t my Sterling database persisting between application loads?
I’m using Sterling, a NoSQL database for .Net, Silverlight, and Windows Phone, to persist some data in a Silverlight 4 application. The intent is to persist it using Isolated Storage. It was obvious that the data was temporarily persisting because the stored data was available on multiple different views in the application. The trouble showed up when I stopped debugging and later started debugging again, the application re-launched and none of the previously persisted data was available.
Initially I was thinking that using the Visual Studio ASP.Net Development server was not maintaining Isolated Storage between application launches. It was far more simple than that. By default, Sterling uses an in-memory driver. If you want to persist using Isolated storage, you must pass an instance of the IsolatatedStorageDriver as an argument when Registering the Database. Note the difference in the samples below.
In Memory
Database = _engine.SterlingDatabase.RegisterDatabase<YourSterlingDatabase>();
Isolated Storage
Database = _engine.SterlingDatabase.RegisterDatabase<YourSterlingDatabase>(new Wintellect.Sterling.IsolatedStorage.IsolatedStorageDriver());
photo credit: Neil Noland / CC BY-SA 2.0
Wednesday, April 11, 2012
Get Started Using NuGet on Visual Studio 2010
You’ve been hearing things about NuGet, but aren’t sure where it is our how to use it. This is a basic instruction on how to get started.
Why NuGet? Developer Productivity. It makes it easier to do things like add Asp.Net Ajax or other libraries and utilities to your project without constantly searching the web for the download and installation process. It is great for items you add to your solutions regularly, but don’t always remember the steps because it has been a while since the last time.
NuGet
- Go to NuGet.org to download and install NuGet, a Visual Studio extension that makes it easier to download and install third party libraries in a Visual Studio project.
- Restart Visual Studio, if you had it open.
- Open the project you want to add the utility or library to.
- Click “Manage NuGet Packages” under the Visual Studio 2010 “Project” menu.
- Search for a utility you are interested in, such as “AjaxControlToolkit”, “Modernizr”, or “MvcScaffolding”.
- Click the “Install” button.