Skip to content

Instantly share code, notes, and snippets.

@davidroberts63
davidroberts63 / gist:3723644
Created September 14, 2012 18:12
Superb NServiceBus exception message
'InputQueue' entry in 'MsmqTransportConfig' section is obsolete.
By default the queue name is taken from the class namespace where
the configuration is declared. To override it, use .DefineEndpointName()
with either a string parameter as queue name or Func<string> parameter
that returns queue name. In this instance, 'Sample.UI' is defined as queue name.
@davidroberts63
davidroberts63 / DateDescriptor.cs
Created November 16, 2012 05:59
Example use of NUnit TestCase
[TestCase(0, "Date1", DateTimeFeature.Day)]
[TestCase(1, "Date2", DateTimeFeature.Day | DateTimeFeature.Year)]
public void Test_Good_Date_Descriptor(int featureIndex, string name, DateTimeFeature feature)
{
var desc = Descriptor.Create<FakeDate>();
Assert.AreEqual(name, desc.Features[featureIndex].Name);
Assert.AreEqual(new DateTimeProperty(feature).Features == ((DateTimeProperty)desc.Features[featureIndex]).Features);
}
@davidroberts63
davidroberts63 / gist:4653491
Last active December 11, 2015 20:09
RavenDB Embedded not storing object when querying for the same object type but none of that type object has been stored before. [NUnit]
[Test]
public void Session_should_store_object_after_querying_same_type_object_that_has_never_been_stored_before()
{
// Arrange
// RavenDB from NUget package: RavenDB.Embedded 2.0.2230
// Raven.Clien.Embedded.dll Product Version: 2.0.0 / 08aa244
var ravenStore = new EmbeddableDocumentStore() { RunInMemory = true };
ravenStore.Initialize();
// Act
@davidroberts63
davidroberts63 / WebApp.xml
Created April 9, 2013 21:32
Sample Nant build file for use with MSBuild to package a Web Application. Some detail were found on Octopus Deploy around the OctoPack tool
<!-- This is from a Nant File with the following properties defined
msbuild.target = Debug | Release
scratch.path = Path\for\some\temporary\folder\for\build\to\go\to
publish.path = Path\where\you\want\the\resulting\zip\or\package\to\end\up
Be sure the OutDir ends with a slash (escaped in this case) otherwise msbuild complains.
OutputPath must NOT have a trailing slash.
WebUI = This is just what I have in the sample, change it to whatever you want for the web ui stuff to go to. This is where your configs and Views will get put, then the bins under that.
@davidroberts63
davidroberts63 / gist:5507410
Last active December 16, 2015 22:29
Log of Octopus Deploy promoting cloud service package to Azure Web Role and Worker Role.
Success: Deploy
2013-05-03 05:31:39 INFO Deployment complete!
Success: Downloading packages from NuGet servers
2013-05-03 05:28:30 INFO Making a list of packages to download
2013-05-03 05:28:30 INFO All packages have been downloaded
Success: Download package Octopus.Sample.AzureCloudService 5.8.2 from NuGet feed: Local
2013-05-03 05:28:30 DEBUG Checking package cache for package Octopus.Sample.AzureCloudService 5.8.2
2013-05-03 05:28:30 INFO Downloading NuGet package Octopus.Sample.AzureCloudService 5.8.2 from feed: 'C:\Program Files (x86)\Octopus\NugetRepository'
@davidroberts63
davidroberts63 / FolderPermissions.ps1
Created May 24, 2013 14:36
Powershell for setting folder permissions
# This script function should work just fine. If you make modifications and notice that the 'Special Permissions'
# right is checked for the folder/file then see thise link for details on how to resolve that.
#
# http://blog.netnerds.net/2007/07/powershell-set-acl-does-not-appear-to-work/
#
function Set-UserToModifyFolderPermission
{
param(
[string]$fullPath,
@davidroberts63
davidroberts63 / RunTests.ps1
Created May 27, 2013 06:18
Powershell Build and Run MSTests
Clear
$testsFile = .\ArgsTests\bin\Debug\ArgsTests.dll
$resultsFile = 'testresults.txt'
function BuildSolution()
{
Write-Host Building solution...
& c:\windows\microsoft.net\framework\v4.0.30319\msbuild.exe
}
@davidroberts63
davidroberts63 / ConfigFileVariables.ps1
Created August 14, 2013 15:00
Apply Octopus Deploy variables to config files during deployment
<#
# Any variables in $OctopusParameters that use the following format will be used.
#
# {config file name w/o extension (aka BaseName)}:{xpath to node value to change}
#
# Examples:
#
# Given the configFilename = log4net.config
# And an Octopus variable named = log4net://configuration/log4net/appender[@name='FileAppender']/file/@value
@davidroberts63
davidroberts63 / install-dotnet45-build.ps1
Last active December 23, 2020 07:02
Installing Jenkins for .NET builds
<#
.NET 4.5 Build Installation script
(run with administrative rights)
You can get the netfx45_dtp.msi (and .cab file) by downloading the Windows SDK
http://msdn.microsoft.com/en-us/windows/hardware/hh852363.aspx
Run the sdk and have the installer download the files for later use.
You can get the vs_isoshell.exe by downloading the Visual Studio Isolated Shell.
http://www.visualstudio.com/downloads/download-visual-studio-vs (That's for 2013)
@davidroberts63
davidroberts63 / NAnt.exe.config-partial
Created November 8, 2013 22:36
NAnt Build .NET Framework 4.5
<configuration>
.......
<framework
name="net-4.5"
family="net"
version="4.5"
description="Microsoft .NET Framework 4.5"
sdkdirectory="${sdkInstallRoot}"
frameworkdirectory="${path::combine(installRoot, 'v4.0.30319')}"