Posts

Getting all profile happy with JustTrace

Image
Recently I have been developing a fair size application and so far everything seemed to be "just working" fine. However during testing I noticed a few times the app seemed to stall up. This left me quite unhappy and I knew it was time to relook at some of my "decisions". Initial glances through the code didn't really highlight anything so I thought it about time to profile the application and see what it can find. In the past I have used Redgate's Ants Profiler and an early version of Telerik's JustTrace. I decided to give Telerik's JustTrace a go again as I have heard alot about it and wanted to see how it's changed / grown. Alas, my initial attempt to use JustTrace ended quite abruptly, I've been developing on Windows 8 and VS2012 exclusively for about 5 months now and sadly JustTrace didn't support IIS8 or IIS Express 8. I was gutted to find this out but a quick chat to the Telerik Dev Team and Chris Eargle gave me hope as they...

Deploying Non Project Files with Web Deploy

Deploying Websites and Web Applications has changed massively over the years, I have seen the likes of FTP, Copy & Paste over RDP (why!!) etc but there has always been a degree of, did I copy the correct files, did I miss any, did I upload the correct client config etc. Since VS2010 I have been a big fan of always publishing my applications to either a local folder and then upload or directly to the server, depending on the setup. One thing I have always struggled with is publishing files that aren't part of my project, and ensuring the correct client config settings are uploaded. Now I'm running VS2012 full time I decided it was time to put to bed these issues and ensure I could use one click, or as near to one as possible, to deploy stage configurations of my applications as well as live. VS2012 has tweaked publishing again, it now includes a much fuller publish model, with WebDeploy amongst the usual FTP, FileSystem etc. The Package / Publish process is just an ext...

Shims Shim Shims

Tonight I started a small project and I thought I'd take the opportunity to explore the new Microsoft.QualityTools.Testing.Fakes library. In case you don't know this library basically allows you to "easily" mock out those pesky sealed classes within the .Net Framework, I've only used it to do System.IO tonight but it does do more. I have a feeling though System.IO will be used heavily with it. What the library allows you to do is to generate a shim version of each sealed class within a dll. So what is a shim? MSDN at the moment says the following: Shim types allow detouring of hard-coded dependencies on static or non-overridable methods. What this means to you and I is you get to create a wrapper type, ShimDirectoryInfo for example, you then set delegates for each method and property that you are going to use on the type and let these return your expected values. When your real code then goes to use the original type, DirectoryInfo in our example, it will...

Portable Class Library Projects and your Build Server

Yesterday my build server started failing on a particular project and after a quick look at the log I found that it simply wasn't building the solution. Peculiar as I knew it built fine on several development machines, however I dug into the logs and found the following:  error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Portable\v4.0\Microsoft.Portable.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. Oh dear, now I know Portable Class Libraries is an add on so I went to MSDN Visual Studio Gallery and got the installer so that I could chuck it on to the build server. However when attempting to install I got a great message saying I needed VS2010 and SP1 installed, obviously for a build server this wasn't going to happen....

Using the SQL Server Export generating an excel spreadsheet from an access database

Image
What a wordy title, go read it again, it's crazy but true. This post covers generating an Excel spreadsheet from an Access Database but using a SQL Server tool. It's crazy but great and easy! Welcome! I am assuming you have SQL Server installed and the import export wizard, if you don't have this go get it first before carrying on. First up open the Import and Export Data application, note this has to be the x86 edition so if you are running an x64 machine, which I think most dev's are nowadays, ensure you choose the correct edition. This will give you the welcome screen. Source Screen Click next to get the ball rolling, this first screen is where we want to get the data from, in this case access, so use the drop down box to select Microsoft Access. Then provide the path to the database file, you can see my file path was actually on the network and it worked fine. Destination Screen Next up the destination, well again Excel is what we want s...

Revisting Linq To Lucene

Last July I wrote a blog post about prototyping getting Entity Framework CodeFirst working with Linq To Lucene . I hadn't realised it was quite that long ago but alas time flies especially with a baby. Anyhow, I never finished the work nor made it "feature" ready or submitted it back to the project, this was partly due to the apparent inactivity. However this week the Linq To Lucene project has become quite active, and as I now need to use the implementation I spent a few hours to finish it. This included working out how to get all the tables off of a DbContext, which involved a bit of reflection magic and then writing some tests to ensure it worked at least how the LinqToSql version had done. I have now submitted this as a patch, http://linqtolucene.codeplex.com/SourceControl/list/patches  - item id 11857, and hope its available in the main trunk soon, enjoy!

Troubleshooting NuGet failing to load

Today I had the unfortunate circumstance for VS2010 to crash whilst I was working, nothing to big I thought, I've had this happen before. I reopened VS went to open my solution and got the following message: --------------------------- Microsoft Visual Studio --------------------------- The 'NuGet.Tools.NuGetPackage, NuGet.Tools, Version=1.6.21215.9133, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' package did not load correctly. EEK! Nuget is smegged :( I immediately thought to uninstall the extension and then reinstall it, same thing happened :( I then, (looking back this was foolish as NuGet is shared), thought I know I just load it in VS11 that will work, it also errored. Not cool, the error message however directs you to start VS with logging enabled by using the /log command argument and then to look at the activity log.  The activity log is located in your appdata roaming folder, simply stick %appdata%\Microsoft\VisualStudio\10.0\ActivityLog.xml in...