Say now that we have written some sort of utility script that really rocks and we would like to make this script available on our system as a global command.
Let's call this script rock.csx
Console.WriteLine("Global scripts rocks!")
| using System; | |
| using System.Reflection; | |
| using DbReader.LightInject; | |
| namespace DbReader.Tests | |
| { | |
| public class ContainerFixture : IDisposable | |
| { | |
| public ContainerFixture() | |
| { |
| using System; | |
| using LightInject.Interception; | |
| namespace InterceptionDemo | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var proxyBuilder = new ProxyBuilder(); |
| /// <summary> | |
| /// Extends the <see cref="IServiceRegistry"/> interface | |
| /// </summary> | |
| public static class ContainerExtensions | |
| { | |
| /// <summary> | |
| /// Registers all implementations of the <see cref="ICommandHandler{TCommand}"/> interface. | |
| /// </summary> | |
| /// <param name="serviceRegistry">The target <see cref="IServiceRegistry"/>.</param> |
| public static class LightInjectServiceConfiguratorExtensions | |
| { | |
| public static Func<T> GetFactory<T>() where T : class | |
| { | |
| return () => ServiceFactoryExtensions.GetInstance<T>(LightInjectBuilderConfigurator.ServiceContainer); | |
| } | |
| public static ServiceConfigurator<T> ConstructUsingLightInject<T>(this ServiceConfigurator<T> configurator) where T : class | |
| { | |
| Type[] interfaces = typeof(T).GetInterfaces(); |
| <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <PropertyGroup> | |
| <!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you --> | |
| <!-- have to teach MSBuild where the Mono copy of the reference asssemblies is --> | |
| <TargetIsMono Condition="$(TargetFramework.StartsWith('net4')) and '$(OS)' == 'Unix'">true</TargetIsMono> | |
| <!-- Look in the standard install locations --> | |
| <BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono> | |
| <BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono> | |
| <BaseFrameworkPathOverrideForMono Cond |
| Console.WriteLine("Hello World"); |
| #! "netcoreapp2.0" | |
| #r "nuget: WindowsAzure.Storage, 9.1.1" | |
| using Microsoft.WindowsAzure.Storage; | |
| using Microsoft.WindowsAzure.Storage.Auth; | |
| using Microsoft.WindowsAzure.Storage.Blob; | |
| await ListLatestOmniSharpRelease(); | |
| public static async Task ListLatestOmniSharpRelease() |
| #load "Calculator.csx" | |
| #load "TestRunner.csx" | |
| #r "nuget:FluentAssertions, 4.19.4" | |
| using FluentAssertions; | |
| RunTestsFrom<CalculatorTests>(); | |
| public class CalculatorTests : IDisposable | |
| { | |
| public CalculatorTests() |