Open a Unity Project Using Right Click

Today I am attending an MVA on Building Windows 10 Games with Unity 5.  It is a lot of information and I will definitely have to re-watch some modules when the recording is released.

One of the presenters, Adam Tuliper, created a nice registry entry for Windows machines to open a Unity project with a right click.  For those that don’t know, Unity is folder based; not solution based like a Visual Studio project.  His registry script allows you to right click on a folder and open it as a Unity project.

http://completedevelopment.blogspot.co.uk/2015/06/open-unity-5-project-with-right-click.html

Using Outlook.com on an Android Phone

How to Use Outlook.com on an Android Phone

I have been using Android phones for a long time now.  I am also not the type to upgrade from a perfectly working phone just because the latest and greatest has come out.  Recently we moved to Verizon’s Edge plan and upgraded our phones, yay.  After using an HTC Droid DNA for so long and previous Android phones I found some things lacking; mainly the lack of integrating with my Outlook.com account.

Read the rest of this entry

NuGet and Package Does Not Exist in Source

Situation

I had been working on a solution that contained several projects.  Due to company conventions I had to rename the projects, name spaces, and change the folder structure.  Things seems to work, builds were good and the applications would run without error.

the problem occurred once I checked it all into TFS, and made everyone target the same framework.  Some how I was getting an error about Entity Framework and that I needed to reinstall it.

I ran the command for each project and both times would receive a message like this one;

Skipped Reinstalling package ‘Name Here’ because the package does not exist in the package source.

My Fix

My fix was simple.  I went to the project and managed its packages.  I noticed that Entity Framework was not even installed.  I thought that kind of odd as I assumed the Update-Package -reinstall would have done it, but I clicked the install button.

Everyone is happy now.

Visual Studio 2015 RC and the Task List

I am currently using Visual Studio 2015 RC and have notice something that is kind of annoying.  It seems the Task List window does not want to populate as quickly as previous versions.  I have not noticed a pattern yet, but I did submit it as a bug.

In the screen shot below I don’t think it picked up that //TODO for an exceptionally long time.  Normally it seems to take a while to pick up my custom tasks, like //INFO.

Missing Task in List

Missing Task in List

Visual Studio 2015 Window Layout

I have to admit I was wrong about the significance of the new Window Layout functionality in Visual Studio 2015.  As it turns out I really have been using this feature.

Window Layout

Window Layout

Visual Studio Safe Mode to the Rescue

Today while using Visual Studio 2015 CTP 6 I encountered a problem.  It kept crashing.  I know earlier today I had installed several extensions; two of which did not come from Microsoft or Microsoft employees.  Naturally I suspected some extensions.

Command Line to the rescue.  You simply start Visual Studio from the command line with the flag to start in safe mode.  Once it comes up you can remove those suspect extensions.

Visual Studio 2015 Break Point Intellisense

I know we have intellisense in Visual Studio 2013 for the break point Condition, but we do not have it for the Action.  I was toying around with 2015 and noticed we now have it for the Action as well.

This is very useful for creating output messages to the debugger window.  In the screen shot below I have an object called myObject.  This object has three properties, an Id, a Name, and a CreatedDate.

Point intellisense

VS 2015 Break Point intellisense

Custom Error Handling In MVC 5

Creating a custom error page in MVC 5 is not too difficult.  If you want to have one that is server farm friendly, well that is not too tough either.  I created a little demo project for doing custom errors that passes a model around.  To be effective in handling uncaught errors we will need to use the Global.asax Application_Error method.  You can also use this method to send errors that you catch but just cannot handle or fail out of gracefully.

There are a number of reasons why you may want to do custom errors like I do below.

  • You are in a server farm or other environment where Session based objects will not work
  • Display a user friendly message based on the error received
  • Display a user friendly message based on an HTTP Code (if one was returned)
  • Log the error
  • Send a notification of the error

Read the rest of this entry

The Danger of Null Values

I made a goof ball mistake today.  I was using LINQ to query a List<> and return the ToString() of the result.  As usual I was using FirstOrDefault() and I simply added .ToString() to the end of it.

fieldValue = (from d in customFields where d.CustomFieldId == fieldId select d.data).FirstOrDefault().ToString();

Of course things worked swimmingly until the Default (null) was hit. At that point I got an Object not set to an instance error.  I had to laugh at myself.

var fieldData = (from d in customFields where d.CustomFieldId == fieldId select d.data).FirstOrDefault();
fieldValue = fieldData != null ? fieldData.ToString() : "";

MVC 5 Placeholders, Prompts and Watermarks

I have noticed an issue with the MVC project in Visual Studio that I am sure others have seen too.  I say this because I have seen a number of solutions in StackOverflow and the ASP.Net forums.  This post is not about some great way to write your own extensions and automagically have the placeholder set in the HTML that is displayed to the user.  No, this is a much simpler method.

Just manually set the placeholder in your Razor syntax.  Chances are you are going in there anyway to tweak a few things instead of using what Visual Studio scaffolded for you.  I would still recommend setting the Prompt in your model though, I suspect that one day this will get fixed or you might actually need it to be automatically generated.  In fact I’d say that if you are writing your own Edit Templates you should include the small extra step to make it auto-generated.

If you are not doing that, here is the easiest fix or work around.

Read the rest of this entry

Follow

Get every new post delivered to your Inbox.

Join 277 other followers