Skip to content

Commit

Permalink
updating to ASP.NET 5 RC2
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed May 22, 2016
1 parent 1c7c2f1 commit d9c4226
Show file tree
Hide file tree
Showing 11 changed files with 4,825 additions and 4,940 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,4 @@ GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
.vs
src/AspNetMvc6Protobuf/project.lock.json
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-final"
"version": "1.0.0-preview1-002702"
}
}
2 changes: 1 addition & 1 deletion src/AspNetMvc6Protobuf/AspNetMvc6Protobuf.xproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ProjectGuid>884513ee-7015-47f0-ac3d-70052b70eb56</ProjectGuid>
<RootNamespace>AspNetMvc6Protobuf</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/AspNetMvc6Protobuf/Controllers/ValuesController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AspNetMvc6Protobuf.Model;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNetCore.Mvc;

namespace AspNetMvc6Protobuf.Controllers
{
Expand Down
4 changes: 2 additions & 2 deletions src/AspNetMvc6Protobuf/Formatters/ProtobufInputFormatter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Net.Http.Headers;
using ProtoBuf.Meta;

Expand Down
6 changes: 3 additions & 3 deletions src/AspNetMvc6Protobuf/Formatters/ProtobufOutputFormatter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Net.Http.Headers;
using ProtoBuf.Meta;

Expand All @@ -23,7 +22,8 @@ public ProtobufOutputFormatter()
{
ContentType = "application/x-protobuf";
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse("application/x-protobuf"));
SupportedEncodings.Add(Encoding.GetEncoding("utf-8"));

//SupportedEncodings.Add(Encoding.GetEncoding("utf-8"));
}

private static RuntimeTypeModel CreateTypeModel()
Expand Down
29 changes: 14 additions & 15 deletions src/AspNetMvc6Protobuf/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

using AspNetMvc6Protobuf.Formatters;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Routing;
using Microsoft.AspNetCore.Routing;
using Microsoft.Net.Http.Headers;

namespace AspNetMvc6Protobuf
Expand All @@ -35,12 +28,9 @@ public void ConfigureServices(IServiceCollection services)
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.MinimumLevel = LogLevel.Information;
loggerFactory.AddConsole();
loggerFactory.AddDebug();

app.UseIISPlatformHandler();

app.UseStaticFiles();
app.UseMvc(routes =>
{
Expand All @@ -50,7 +40,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
});
}

// Entry point for the application.
public static void Main(string[] args) => WebApplication.Run<Startup>(args);
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(System.IO.Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

host.Run();
}
}
}
95 changes: 66 additions & 29 deletions src/AspNetMvc6Protobuf/project.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,77 @@
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"userSecretsId": "aspnet-WebApp_Auth-96d521e3-30ac-4a8f-967f-abc243174dce",

"dependencies": {

"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",

"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-final",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-final",
"Microsoft.Extensions.DependencyModel": "1.0.0-*",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"protobuf-net": "2.0.0.668"
},

"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},

"frameworks": {
"dnx451": { }
"Microsoft.Extensions.SecretManager.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},

"frameworks": {
"net46": {}
},

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},

"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
"runtimeOptions": {
"gcServer": true
},

"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},

"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}

Loading

0 comments on commit d9c4226

Please sign in to comment.