0

Developer Developer Developer 8a 23rd Oct 2010; Another great community day by the DDD team

by Jon 23. October 2010 18:59

I’m heading home after another long but fantastic day at Microsoft Reading, UK.  The day officially started started at 8am with bacon butties laid on by the venue hosts Microsoft who provided an excellent venue for this Mini Geekathon at there UK offices in Reading.  However that is pretty much where Microsoft's roles ends and the community takes over.  Developer Developer Developer is a group of individuals that get sponsorship and lay on development events around the UK.  The DDD events are FREE events organised by developers for developers; todays event was titled Modern.Net.  Modern.Net is .NET we can do now with current tools the idea of the day was to cover all the latest things in .NET that developers can use now to target Acer Aspire One, Amazing Battery Lifenew platforms and write better code.  I came armed with my new mini Acer aspire one, which appears to have better battery life than I expected.  I was surprised to see 8hours 46 mins remaining after a couple of hours of use on the way down and that's with Bluetooth turned on and active!

The day was split Into two rooms which made it really difficult to choose sessions to attend as I would have loved to see the sessions that were running in the room next door.  I resolved this problem by pretty much deciding which session to attend at the last minute.

WP7, iPhone, Droid - Oh My ! - Chris Hardy

Did you know you could develop against the three most important smart phone device types just with.NET?  Chris went through the different ways you develop each platform, explaining the differences and requirements for each smartphone.

Phone Platform Cost My Notes
Windows Phone7 Windows,
Visual Studio
vs2010 Express $0
Appstore $99 PA
Nice and simple develop, as it is just Silverlight.  It has some oddities due to Tombstoning but this should be the easiest and cheapest platform for .NET developers to get into.
iPhone Mac, Mono Develop, Mono Touch Monotouch $400, Appstore $99 PA You need a Mac to develop this because you need to have the IPhone SDK that only works on a Mac.  There are lots of restrictions and tricks (ahead of time compiler, stripping out bits of the framework you don’t need at compile time) that have been performed by the MonoTouch developers to get this to work which means you will always be lumbered with a larger assemblies.  However the advantages of using MonoTouch over Objective C is Clear and it now sounds like Apple has now embraced MonoTouch as an easier way of developing for there platform.
Android Mac/Windows/Linux, Mono Develop, Mono Droid MonoDroid $1000
Appstore $25 One Off
Although MonoDroid is at an early stage it looks the most exciting to me; apart from the high cost of the Licence for MonoDroid.  You can develop MonoDroid from any platform, and although there is the odd fudge it looks like it will be a much better development experience for developers when the product is released.  You can create widgets and applications with MonoDroid, and you can get access to other libraries such as OpenGL.  There are currently a couple of issues including asynchronous and multi Threading not working yet but they will be fixed when MonoDroid is released.

 

Chris Scaring us with MonoTouch Minimum App SizeWP7 is clearly the easiest platform to develop for in .Net but the advantages of .Net for the other smartphones is clear.  Developers are now able to separate logic and develop a re-useable libraries that if developed carefully can be reused between the platforms thus reducing the pain of developing cross platform smartphone applications .  Most Interestingly I personally think that the relatively low cost and ease of development bodes very well for the new WP7 platform.

Managed Extensibility Framework - Kathleen Dollard

This was my favourite session of the day; i had heard bits and bobs about MEF from other developers prior to this session but I haven't had time to investigate it so I was looking forwards to this session by Kathleen.  Kathleen enthusiastically explained MEF from the basics to the detail by rattling through two presentations in the limited time at breakneck speed.  I didn’t get it all and the certainly wasn’t time for detailed notes but here are the basics.

MEF is different, stands for Managed Extensibility Framework and developers can used it to develop separate units that can work together but so the logic can separated more sensibly.  Imagine a room of kids drawing things, some have crayons some don’t, some kids are shouting I want a crayon, other kids are shouting I want a crayon.  MEF is the system that can be used connect the kids who want crayons to people who have crayons.  There are currently two models available to do this, one of the models is designed especially for Silverlight, the other is more general purpose for dotnet.

One thing I found interesting is that essentially it is DIY SOA, if you want a flexible SOA architecture this seems like a great way to go.  Kathleen gave lots of examples why MEF or something like it is the future.  Although I haven’t explained it very well it looks like a much much better way of developing systems, I defiantly need to see more sessions on MEF as I want to use it for some personal projects.

Dynamic Consumption in C# 4.0 - Oliver Sturm

I had seen Oliver Sturm before when he took us through f'# one evening after UkTechdays, gosh he is a clever bloke.  In this session Oliver took us through dynamic consumption and some of the dynamic features in c# 4.0.  As far as I can tell a chunk of the dynamic features in c# 4.0 have originated from vb.net so some of the ohhs and ahhs are less impressive to me as I have been using them for years and years in vb.net, c# has essentially caught up with vb.net, and has a few new dynamic features.  After demonstrating the dynamic features of c# he demonstrated how you can call dynamic languages from within c#, first doing office automation, and next calling out to python using a python library and returning the results into c# looks interesting if you need that kind of thing.  The summary c# isn’t dynamic but it can now interact with dynamic languages.  Useful to know if I ever need to do it, but at the moment its not something I will be doing.  IMO Vb.net developers will be less impressed with this presentation, but it was an interesting one to go to.

Lunch and Grok Talks

Jon Skeet wowing the audianceLunch was kindly provided by Microsoft and we sat in the main lecture hall munching away listening to some concise talks on a variety of subjects.  I liked the concept of a 20:20 presentation, 20 PowerPoint slides in set to auto run at 20 seconds for each slide, the presentation was on @plip and twitter but i liked the concept.  The talk on Behaviour Driven Design (BDD) was interesting, the presenter showcased his own framework for F'# called TickSpec.  I can see how his framework methodology has its benefits for highly specified systems.  Finally dinner ended in a geekout with different presenters from the day answering questions on .net and development theory from the audience, eye opening and I discovered an alterative (cooler?) way to say tuple!

Modern C#: This is not your grand-daddy's language - Jon Skeet

23102010163

Jon Skeet pretty summed up the entire day with his presentation on modern C#.  The theme of the presentation was the theme of the day, Modern.Net and how it has evolved over the years by doing a direct comparison between the oldest and the newest version.  We can express more than we could before, C# 1 was wobbly wobbly, but today C# 4 is more descriptive and defined.

23102010162

Jon lead us through the differences by deep diving into the code, he wrote the same code in both versions; find the maxby and return it and tried to make both solutions as defined and generic as possible.  The C# 1 code turned out to be simpler and shorter but the bug difference was in the reusability and strictness.  The C# 4 code was more reusable and strict at the same time, you had to jump through some nasty hoops to make the C# 1 code anywhere near as reusable and sensible.  At the end the C# was still shorter, but the client code required to use it had to be longer and there was defiantly a bigger chance to make an error with the C# 1 calling code.

At the end of an interesting talk, we were left everyone with a chunk of interesting thoughts…

  • f# is complicated but it has lots of inertia in the industry
  • Learn F# to improve your c# (and vb.net ;p)
  • Think about what is coming in future, dotnet 5

IMHO the future is more CPUs, so its worth bearing in mind when looking to the future.

WPF in Modern .NET - Ian Griffiths

Unfortunately I missed the start of this talk due to the start of a migraine, starting to feel very tired, and listening to Jon Skeet outside the hall for the first 15 mins of this session.  I stood at the back with @NathanGloyn and I took the opportunity to charge all mu devices, which stopped me from taking any notes.  Ian defended WPF throughout the session but in my mind didn’t really give much to backup his defence.  I’ve seen WPF before and yes it has its advantages and yes it will be used but I still don’t get the separation between Silverlight and WPF.  In my mind why separate the two it would be much better to have Silverlight, Silverlight, even if there are differences diluting two frameworks and having two brands doesn't seem the most sensible strategic decision.

Summary

And with that that was it, another long development day.  We all caught the bus back to the train station and scuttled off home on the train.  Thanks to all the organisers, and Microsoft for the venue, it was another fantastic day.  Hopefully one day I will complete a blog post on the day of a DDD event before a migraine stops me in my tracks!

Tags: , , , , , , , , , ,

conference | ddd | vs2010

0

TeamCity via IIS on port 80, using a reverse proxy in IIS7, 30 second job, Part 1

by Jon 23. October 2010 06:55

So you have your TeamCity system, but annoyingly if you already have IIS on the server your TeamCity probably won’t be accessible on standard web port.  Wouldn’t it be nice to be able to host or access TeamCity via IIS 7.5 via one firewall rule, and get access to TeamCity from any coffee shop or site with restricted internet in the world?  Its much easier than you think in IIS 7.5, a real 30 second job to get it working using Application Request Routing (which is normally used to load balance webfarms) to setup a reverse proxy.

1. Download and Install Application Request Routing for IISS (2.0), using the web platform installer

Web Platform Installer

2. Start Internet Information Services Manager (IIS Manager).  Left Click on the Server Name Node to bring up the server configuration in the right pan and double click on Application Request Routing in the IIS Section.

 Click On Application Requestion Routing 

3. A Server Farms Node will Appear in the left hand side treeview, right click on the node and select Create Server Farm.  Give your new server Farm/reverse proxy a name

Enter a Name for TeamCity Server Farm

4. Press Next, enter localhost or your TeamCity server name, press advanced and change the port to the port that your TeamCity currently runs under.

Expand Advanced Settings, and Enter the port that TeamCity is running under

5. Press Finish, and press yes when prompted if you want the rewrite rules written for you.

Allow IIS to automatically rewrite the URLs

6. Finally navigate to your TeamCity Installation using a port free url go to administration->Server Configuration and remove the port from the Server Url and your done.

7. If you want to run other websites on this IIS Server you will need to continue onto Part 2- setup filtering so only specific hosts are forwarded onto TeamCity.

Tags: , , ,

Continuous Integration | development | IIS | TeamCity.Net

0

So you want to partially rename loads of files, keep the names intact, and you just want to use a batch file

by Jon 12. October 2010 14:36

So you have a load of files containing the same word which all need to be replaced with another word.  You could buy some software or just use this batch file:

Create a Batch File Called Replace.bat in the folder containing the files you want to rename

@echo off

setlocal

set /p Srch=Text in filename to find:

set /p Repl=Text to replace "%Srch%" with:

echo Searching for filenames containing "%Srch%" and replacing with "%Repl%" ...

for /f "tokens=*" %%a in ('dir /b *%Srch%*') do call :Replace "%%a"      

goto :EOF

:Replace

set x=%1

call set x=%%x:%Srch%=%Repl%%%

ren %1 %x%

Double Click on the Batch File Enter the File Text you want to replace, and the new text

Rename with a Batch Script

And the files are renamed as you expect

Rename Complete

It feels a little old school but hey it works on all pcs without needing to install anything and thats exactly what you need in situations where you need to rename lots of files at the same time

Tags:

Batch | Maintanance

0

The zip file containing your deployment may have been corrupted, or your Reference Hint Paths are wrong

by Jon 6. October 2010 15:53

So you zip up your package, and you download it to your customers site to install onto there server and you get the following error:

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file

Exception Details: System.Secuity.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral

Your deployment may have been corrupted

You know nothing has changed the system works find on your test server, your laptop and everywhere else its just broken here, and nothing major has changed since the last release!  What can be wrong? One of two things:

Your dll references and Hint Paths could be wrong, open up your Project files and look for incorrect hint paths causing your solution to be compiled with a range or dlls causing your very own dll hell.  Or alternatively your zip and dlls could have been corrupted in some way, either way its not good.

Hopefully this post will help you find the root of your problems, the obscure error means your installation is corrupted in some way..

Tags:

Bug

0

Automatic CI Versioning using TeamCity and MSBuild

by Jon 4. October 2010 20:33

If you read my first post on getting started with TeamCity, and my follow up post on moving to MSBuild you will have a lovely CI system that builds your solution each you commit your changes.  Whilst this sounds fantastic, unfortunately of the assemblies that are built will all be versioned with the same version that is pulled from the AssemblyInfo.  Luckily it isn't a major change to get MSBuild to update your solution files with the version number stored in TeamCity every time a build occurs by tweaking your MsBuild File: (and installing MsBuild Community Tasks)

<?xml version="1.0" encoding="utf-8" ?> 
<Project  DefaultTargets="ReleaseBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>

    <Target Name="ReleaseBuild">

        <Message Text="Set the correct $(BUILD_NUMBER)" /> 
	<FileUpdate Files='AssemblyInfo.vb' 
	  Regex='Version\("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"\)' 
	  ReplacementText='Version("$(BUILD_NUMBER)")' />

	<FileUpdate Files='AssemblyInfo.cs' 
	  Regex='Version\("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"\)' 
	  ReplacementText='Version("$(BUILD_NUMBER)")' />

        <Message Text="Building"/> 
        <MSBuild Projects="ProjectName.sln" Targets="Rebuild" /> 

    </Target>
</Project>

 

Shared Solution Level Assembly InfoThis change uses the FileUpdate Task in MsBuild Community Tasks to be performed on the two specified files, AssemblyInfo.vb and AssemblyInfo.cs.  The Regex will search for the word Version, followed by a valid four digit string version, and replace it with the build version configured in team city.

I use a Solution wide AssemblyInfo file called SolutionAssemblyInfo.vb or SolutionAssemblyInfo.cs to standardise Assembly Information across the solution by using a single shared file.  You can Create this shared file in Visual Studio by Adding a New Item to the Solution Directly, and then after you have created it you link it into each project by clicking on Add existing in each project and pressing the Arrow on the 'Add' Button and selecting 'Add as Link' instead.  This Shared Solution wide file contains the assembly info that is shared across the assemblies, each project will contain the link to shared assembly info file, and the existing assembly info file in the My Project folder.

Tags: , ,

ddd | development | MSSQL Server | Versioning

Powered by BlogEngine.NET 2.0.0.36
Original Design by Laptop Geek, Adapted by onesoft, and finally some tiny tweaks by JonAlb