daniewat82

Stories submitted by daniewat82

Error From The Trenches - [No relevant source lines] Source File: none(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 1 year, 8 months ago

I did a little reading afterwards and found out that when you add a .browser file to any ASP.NET based application some code generation is performed during compilation. Unfortunately due to the security block that had been placed on downloaded file an exception was thrown from deep down in the bowels of the .NET framework which in turn did not bubble up to the application. Afterwards I discovered that the information we needed to solve the issue was in the windows application log. read more...

add a comment |category: |Views: 3

tags: another

Raven DB – Part 1 – DocumentSession per request with StructureMap(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 1 year, 11 months ago

I am a big fan of the repository and session per request patterns and have been using these when working with NHibernate for the last few years. Whenever I currently implement these patterns with NHibernate I use an IOC container to manage the lifetime of the NHibernate session (per request), with Raven I decided to do the same to manage the DocumentSession (per request) and also the DocumentStore (singleton). read more...

add a comment |category: |Views: 41

tags: another

Extension Method From The Trenches – C# Week Of Year(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 1 year, 11 months ago

I discovered there was no easy way to get the week number from a DateTime (I really expected there to be a WeekOfYear property on DateTime but there is not. Luckily it is a pretty easy to work this information out. read more...

add a comment |category: |Views: 10

tags: another

C# Null – Which types can accept null?(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years ago

A few days ago someone asked me which types can accept null and also how could this be determined at runtime. After a quick Google and some chit chat we found that only if the variables type is not a value type or the variables type has a generic type definition of Nullable<> can the variable accept null . This is really helpful to know when you are dynamically invoking methods at runtime and you are not sure if the methods parameters will accept the passed in values. read more...

add a comment |category: |Views: 17

tags: another

Tribe.Cache – Cache Dictionary Beta Release(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 1 month ago

Today I have released the first beta of Tribe.Cache. Tribe.Cache is a dictionary store which acts as a mechanism to perform caching at an application level (ideal for single server web applications or rich client applications). read more...

add a comment |category: |Views: 5

tags: another

Using WCAT and perfmon to performance test your ASP.NET application(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 1 month ago

I needed to stress test the current open source project I am working on (Tribe.Cache – Dictionary Cache) under heavy load. I decided that to do this I would put together a simple ASP.NET MVC site that would get a new instance of an object and then insert it into the cache or alternatively read from the stale object from the cache dependant on the cache items expiration. I setup my simple site under IIS7….. But now I needed to throw thousands of HTTP requests at the site in order to see how the cache and application would behave and perform under heavy load. read more...

add a comment |category: |Views: 77

tags: another

XUnit FreezeClock – Black Magic Stopping Time(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 1 month ago

All that is needed is to add the FreezeClock attribute to a method, and then when you need to get the frozen DateTime you call Clock.Now. read more...

add a comment |category: |Views: 7

tags: another

C# HttpRuntime - Simple Cache(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 1 month ago

I have been working recently on an application that needs very simple caching. I found this code sometime ago (but can’t for the life of me remember where! I think it may have been on StackOverflow). It is a simple cache that uses the HttpRuntime which enables it to be used on the web and also the desktop. This code has saved my bacon on more than one occasion so I thought I would share it. read more...

add a comment |category: |Views: 26

tags: another

ASP.NET MVC working smart with cookies – Custom ValueProvider(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 2 months ago

ValueProviders are the mechanism within the MVC framework that tries to take information from the HTTP Request and then resolve parameter values on action methods. Complex as well as simple types will be resolved using one of the four inbuilt value providers listed. read more...

add a comment |category: |Views: 89

tags: another

IIS7 Does Not Allow Cross Domain Calls In Full Trust Mode By Default –(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 2 months ago

I have been working on a project recently where I have been making cross domain web requests to twitter using the Yedda.Net library. Everything was working correctly when executing the source using Visual Studio and Cassini (Visual Studios built in web server) but when I made a trial deployment I ran into a security exception. read more...

add a comment |category: |Views: 30

tags: another

Configuring NHibernate to use MySql – and the small runtime gotcha!(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 3 months ago

Currently I am in the process of building (yet another) open source blog engine (public repository will be setup soon – I am just getting the core written first!). I really want this application remain database agnostic, so I am using NHibernate to satisfy my data access needs. I ran info a few issue’s when setting up NHibernate to work with MySql and thought it best to share my findings from the last 2 hours of torment. :-) read more...

add a comment |category: |Views: 17

tags: another

ASP.NET MVC – Dynamically Changing The Master Page (Theming)(www.dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 3 months ago

In the last two weeks I have seen this technique spoken about twice! It is a hot topic at the moment…. how do you have multiple themes for an ASP.NET MVC web application and then set the desired theme dynamically? There are multiple ways to implement this and in this post I will explain my preferred method. I like to have multiple master pages with each master page linking to its own set of assets and styles, then dynamically changing the master page used based on a route parameter. read more...

add a comment |category: |Views: 193

tags: another

Property Matching With Data Annotations(dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 4 months ago

I wondered if it would be possible to compare two properties using data annotations. Usually you place the data annotations attribute on a property to validate the data in some way. I quickly knocked up a custom ValdationAttribute that could be placed on a class that checks for equality between two properties of the class. It checks both type and value equality. read more...

add a comment |category: |Views: 65

tags: another

My Ultimate Dev Machine 2010 – Reducing Frustration (My New Years Reso(dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 4 months ago

Anyone who has worked with me or knows me will understand I have very little patience! This is probably my worst personality trait. I started to think about my day to day frustrations and what I can change and what I can’t. Slow pc’s are an issue, wasting time waiting for a PC to perform an action is one thing that frustrates me enormously ! But I can change this! Buy a faster pc! (To be honest the above is just a justification to make me feel better about spending money on a new dev machine!) read more...

add a comment |category: |Views: 10

tags: another

SQLite Nunit & Fluent NHibernate - Test your data access layer – Round(dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 5 months ago

Last month I wrote a post explaining how to test your data access layer by using Fluent NHibernate to generate an in-memory SQLite database from an applications domain model and fluent mappings. You can then run unit tests against the SQLite database rather than mocking objects. Over the last couple of weeks I have become less fond of Fluent NHibernate (long story! Curse & Swear!) and wanted to recreate the same functionality using NHibernates standard mappings and features. So without further adieu….. read more...

add a comment |category: |Views: 276

tags: another

ASP.NET MVC – Image Controller & Thumbnail Action(dotnetguy.co.uk)

submitted by daniewat82daniewat82(114) 2 years, 6 months ago

If you need to resize an image or create a thumbnail on the fly there are number of ways to do so in ASP.NET MVC. After a quick scout around on Google I decided to create some reusable code. I needed three main classes to get this up and running - ImageController, ThumbnailResult and some html helpers to generate the mark-up for the view. read more...

add a comment |category: |Views: 274

tags: another