Skip to main content

Posts

Showing posts from 2024

.Net Events

Events Background While theoretically delegates could be used by consumers as an even mechanism, it has some serious drawbacks. If we made our delegate public and allowed subscribers to add methods to our delegates invocation list, they would be able to receive notifications. However they would also be able to do something like the following:  MessageLogger = null;  In one misused line of code, our delegate has been wiped out along with it's invocation list and any link to subscribers has been lost. As a result, Events act as an abstraction on top of delegates to manage the invocation list with fairly limited  Add  and  Remove  operations. Subscribers go through the public event to add methods which in turn acts on the underlying delegate invocation list. What is an Event? Events allows a class to send notifications to other classes or objects that subscribe to the event. When an event is raised, any objects that have subscribed to the

Use Azure DNS for you web app

New-AzDnsRecordSet -ZoneName happycampervan.co.uk -ResourceGroupName happycampervan `  -Name "@" -RecordType "txt" -Ttl 600 `  -DnsRecords (New-AzDnsRecordConfig -Value  "happycampervan.co.uk") A Record ----------- New-AzDnsRecordSet -Name "@" -RecordType "A" -ZoneName "happycampervan.co.uk" `  -ResourceGroupName "happycampervan" -Ttl 600 `  -DnsRecords (New-AzDnsRecordConfig -IPv4Address "51.140.185.151") CName Record ------------ New-AzDnsRecordSet -ZoneName happycampervan.co.uk -ResourceGroupName "happycampervan" `  -Name "www" -RecordType "CNAME" -Ttl 600 `  -DnsRecords (New-AzDnsRecordConfig -cname "happycampervan.co.uk") Remove-AzDnsRecordSet -RecordType "CNAME" -Name "www" -ZoneName "happycampervan.co.uk" -ResourceGroupName "happycampervan" -Confirm:$False TXT record -----...

Semantic Logging in Windows Azure - Part 2

In this second part of the series, we will configure the Semantic Logging Application Block (SLAB) in a Windows Azure role Out-Of-Process. Please read Part 1 - Semantic Logging  if you are unfamiliar with SLAB or want some background, including a source code starter project. When selecting suitable sinks for Azure, there are some obvious challenges. Your roles are virtual machine (vm) instances which are subject to recycles and shutdowns. When logging events on a vm with SLAB, both the logger and the listeners need to be running on the same instance. Multiple listeners and loggers can exist on the same vm. Prerequesites In order to  Windows Azure SDK 2.0 Windows Azure Emulator running  At Assemblysoft we specialise in  Custom Software Development  tailored to your requirements. We have experience creating Booking solutions, as we did for HappyCamperVan Hire. You can read more  here . We can onboard and add value to your business rapidly. We ar