File tree Expand file tree Collapse file tree 3 files changed +12
-22
lines changed
Expand file tree Collapse file tree 3 files changed +12
-22
lines changed Original file line number Diff line number Diff line change 1414// See the License for the specific language governing permissions and
1515// limitations under the License.
1616
17- using System . IO ;
17+ using Microsoft . AspNetCore ;
1818using Microsoft . AspNetCore . Hosting ;
1919
2020namespace SymbolService
@@ -23,14 +23,12 @@ public class Program
2323 {
2424 public static void Main ( string [ ] args )
2525 {
26- var host = new WebHostBuilder ( )
27- . UseKestrel ( )
28- . UseContentRoot ( Directory . GetCurrentDirectory ( ) )
29- . UseIISIntegration ( )
26+ BuildWebHost ( args ) . Run ( ) ;
27+ }
28+
29+ public static IWebHost BuildWebHost ( string [ ] args ) =>
30+ WebHost . CreateDefaultBuilder ( args )
3031 . UseStartup < Startup > ( )
3132 . Build ( ) ;
32-
33- host . Run ( ) ;
34- }
3533 }
3634}
Original file line number Diff line number Diff line change @@ -24,22 +24,16 @@ namespace SymbolService
2424{
2525 public class Startup
2626 {
27- public Startup ( IHostingEnvironment env )
27+ public Startup ( IConfiguration configuration )
2828 {
29- var builder = new ConfigurationBuilder ( )
30- . SetBasePath ( env . ContentRootPath )
31- . AddJsonFile ( "appsettings.json" , optional : false , reloadOnChange : true )
32- . AddJsonFile ( $ "appsettings.{ env . EnvironmentName } .json", optional : true )
33- . AddEnvironmentVariables ( ) ;
34- Configuration = builder . Build ( ) ;
29+ Configuration = configuration ;
3530 }
3631
37- public IConfigurationRoot Configuration { get ; }
32+ public IConfiguration Configuration { get ; }
3833
3934 // This method gets called by the runtime. Use this method to add services to the container.
4035 public void ConfigureServices ( IServiceCollection services )
4136 {
42- // Add framework services.
4337 services . AddMvc ( ) ;
4438 }
4539
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Web" >
22
33 <PropertyGroup >
4- <TargetFramework >netcoreapp1.1</TargetFramework >
4+ <TargetFramework >netcoreapp2.0</TargetFramework >
5+ <AssemblyName >SymbolService</AssemblyName >
56 </PropertyGroup >
67
78 <ItemGroup >
89 <DotNetCliToolReference Include =" Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version =" 1.0.2" />
910 </ItemGroup >
1011
1112 <ItemGroup >
12- <PackageReference Include =" Microsoft.AspNetCore" Version =" 1.1.5" />
13- <PackageReference Include =" Microsoft.AspNetCore.Mvc" Version =" 1.1.6" />
14- <PackageReference Include =" Microsoft.Extensions.Logging" Version =" 1.1.2" />
15- <PackageReference Include =" Microsoft.Extensions.Logging.Debug" Version =" 1.1.2" />
13+ <PackageReference Include =" Microsoft.AspNetCore.All" Version =" 2.0.5" />
1614 <PackageReference Include =" Mono.Cecil" Version =" 0.10.0-beta7" />
1715 </ItemGroup >
1816
You can’t perform that action at this time.
0 commit comments