private AspNetRemote CreateAspNetRemote(AspNetAdapterArguments arguments) {
            // pretty terrible, any better ideas?
            var assembly = Assembly.GetExecutingAssembly();
            File.Copy(assembly.Location, Path.Combine(arguments.ApplicationPhysicalPath, "bin", Path.GetFileName(assembly.Location)), true);
            // might be useful to copy dependencies as well

            var remote = (AspNetRemote)ApplicationHost.CreateApplicationHost(typeof(AspNetRemote), "/", arguments.ApplicationPhysicalPath);
            remote.SetApplicationData(arguments.ApplicationData);
            return remote;
        }
예제 #2
0
        private AspNetRemote CreateAspNetRemote(AspNetAdapterArguments arguments)
        {
            // pretty terrible, any better ideas?
            var assembly = Assembly.GetExecutingAssembly();

            File.Copy(assembly.Location, Path.Combine(arguments.ApplicationPhysicalPath, "bin", Path.GetFileName(assembly.Location)), true);
            // might be useful to copy dependencies as well

            var remote = (AspNetRemote)ApplicationHost.CreateApplicationHost(typeof(AspNetRemote), "/", arguments.ApplicationPhysicalPath);

            remote.SetApplicationData(arguments.ApplicationData);
            return(remote);
        }
예제 #3
0
 public AspNetAdapter(Func <IDictionary <string, object>, Task> next, AspNetAdapterArguments arguments)
 {
     _next      = next;
     _remote    = this.CreateAspNetRemote(Argument.NotNull("arguments", arguments));
     _converter = new CrossAppDomainDataConverter();
 }
 public AspNetAdapter(Func<IDictionary<string, object>, Task> next, AspNetAdapterArguments arguments) {
     _next = next;
     _remote = this.CreateAspNetRemote(Argument.NotNull("arguments", arguments));
     _converter = new CrossAppDomainDataConverter();
 }