Skip to content

Instantly share code, notes, and snippets.

View sdanna's full-sized avatar

Steven D'Anna sdanna

View GitHub Profile
task Publish -depends Compile {
Remove-Item $build_dir -Recurse -Force -ErrorAction SilentlyContinue #Cleanup the build directory
exec {
msbuild $source_dir\$project_name.sln /property:DeployOnBuild=true /property:PublishProfile=$project_config /property:UserName=<IISManagerUserName> /property:Password=<IISManagerUserPassword> /property:AllowUntrustedCertificate=true /v:q /nologo /clp:ErrorsOnly
}
}
@sdanna
sdanna / web.csx
Last active November 12, 2015 22:36
Add("MyInteger",42);
var theAnswer = Config.Global.Get<int>("MyInteger"); // 42
@sdanna
sdanna / web.csx
Last active November 12, 2015 23:01
#r "bin\MyComponents.dll"
Add("myComponent", new MyComponents.CustomObject { Id = 3, Text = "Blah" });
var myComponent = Config.Global.Get<CustomObject>("myComponent");
Debug.WriteLine(myComponent.Id); // 3
Debug.WriteLine(myComponent.Text); // Blah
<appSettings>
<add key="Server.EnvironmentName" value="debug" />
</appSettings>
protected void Application_Start()
{
// Standard MVC Stuff goes here.
// Load config-r configuration file based on the environment appSetting
var environment = ConfigurationManager.AppSettings["Server.EnvironmentName"];
Config.Global.LoadScriptFile($"Web.{environment}.csx");
}
public Foobar(string value, string displayName, params string[] extraData)
{
// Implementation
}
public Foobar(string value, params string[] extraData)
{
// Implementation
}
var foobar1 = new FooBar("Value1", "ExtraData1", "ExtraData2", ExtraData3");
var extraData = new string[] {"ExtraData1", "ExtraData2", "ExtraData3"};
var foobar2 = new FooBar("Value1", extraData);