Пример #1
0
        public DefaultRuntimeEnvironment(String complieConfiguration, IInstanceIdProvider instanceIdProvider)
        {
            Guard.ArgumentNotNull(instanceIdProvider, nameof(instanceIdProvider));

            _instanceIdProvider           = instanceIdProvider;
            this.IsDevelopmentEnvironment = (complieConfiguration.IfNullOrWhiteSpace(String.Empty)).CaseInsensitiveEquals("development");
            this.Environment         = complieConfiguration.IfNullOrWhiteSpace("Production").ToLower();
            this.ApplicationBasePath = SchubertUtility.GetApplicationDirectory();
            this.RuntimeFramework    = Assembly.GetEntryAssembly().GetCustomAttribute <TargetFrameworkAttribute>().FrameworkName;
        }
Пример #2
0
        public AspNetEnvironment(IHostingEnvironment hosting, IInstanceIdProvider instanceIdProvider)
        {
            Guard.ArgumentNotNull(hosting, nameof(hosting));
            Guard.ArgumentNotNull(instanceIdProvider, nameof(instanceIdProvider));

            this.Environment = hosting.EnvironmentName.IfNullOrWhiteSpace("production").ToLower();
            this.IsDevelopmentEnvironment = hosting.IsDevelopment();
            this.RuntimeFramework         = Assembly.GetEntryAssembly().GetCustomAttribute <TargetFrameworkAttribute>().FrameworkName;
            //this.ApplicationBasePath = Microsoft.DotNet.PlatformAbstractions.ApplicationEnvironment.ApplicationBasePath;
            this.ApplicationBasePath = SchubertUtility.GetApplicationDirectory();

            _instanceIdProvider = instanceIdProvider;
        }