diff --git a/.gitattributes b/.gitattributes index 1ff0c42..4f1f650 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,63 +1,50 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### -* text=auto +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp +*.jpg binary +*.png binary +*.gif binary -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary +*.cs text=auto diff=csharp +*.vb text=auto +*.resx text=auto +*.c text=auto +*.cpp text=auto +*.cxx text=auto +*.h text=auto +*.hxx text=auto +*.py text=auto +*.rb text=auto +*.java text=auto +*.html text=auto +*.htm text=auto +*.css text=auto +*.scss text=auto +*.sass text=auto +*.less text=auto +*.js text=auto +*.lisp text=auto +*.clj text=auto +*.sql text=auto +*.php text=auto +*.lua text=auto +*.m text=auto +*.asm text=auto +*.erl text=auto +*.fs text=auto +*.fsx text=auto +*.hs text=auto -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain +*.csproj text=auto +*.vbproj text=auto +*.fsproj text=auto +*.dbproj text=auto +*.sln text=auto eol=crlf \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4d37a9e..b1ba2b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,158 +1,33 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates -*.sln.ide/ -PublishProfiles/ - -# Build results - -[Dd]ebug/ -[Rr]elease/ -x64/ -build/ -[Bb]in/ [Oo]bj/ - -# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets -!packages/*/build/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.log -*.scc - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler +[Bb]in/ +TestResults/ +.nuget/ +_ReSharper.*/ +packages/ +artifacts/ +PublishProfiles/ +*.user +*.suo +*.cache +*.docstates +_ReSharper.* +nuget.exe +*net45.csproj +*net451.csproj +*k10.csproj *.psess *.vsp -*.vspx - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -.*crunch*.local.xml - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.Publish.xml - -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ - -# Windows Azure Build Output -csx -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.[Pp]ublish.xml -*.pfx -*.publishsettings - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - - -#LightSwitch generated files -GeneratedArtifacts/ -_Pvt_Extensions/ -ModelManifest.xml - -# ========================= -# Windows detritus -# ========================= - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Mac desktop service store files -.DS_Store +*.pidb +*.userprefs +*DS_Store +*.ncrunchsolution +*.*sdf +*.ipch +/Entropy.sln.ide +project.lock.json +.vs/ +bower_components/ +node_modules/ +*/*.Spa/public/* +*/*.Spa/wwwroot/lib +*launchSettings.json \ No newline at end of file diff --git a/src/BugTracker/Controllers/HomeController.cs b/src/BugTracker/Controllers/HomeController.cs index 461bc2c..9abd290 100644 --- a/src/BugTracker/Controllers/HomeController.cs +++ b/src/BugTracker/Controllers/HomeController.cs @@ -2,7 +2,7 @@ namespace BugTracker.Controllers { - public class HomeController: Controller + public class HomeController : Controller { public IActionResult Index() { diff --git a/src/BugTracker/CopyAspNetLoader.cmd b/src/BugTracker/CopyAspNetLoader.cmd deleted file mode 100644 index 6060688..0000000 --- a/src/BugTracker/CopyAspNetLoader.cmd +++ /dev/null @@ -1,8 +0,0 @@ -REM copy the AspNet.Loader.dll to bin folder -md bin - -SET ASPNETLOADER_PACKAGE_BASEPATH=%USERPROFILE%\.kpm\packages\Microsoft.AspNet.Loader.IIS.Interop -REM figure out the path of AspNet.Loader.dll -FOR /F %%j IN ('dir /b /o:-d %ASPNETLOADER_PACKAGE_BASEPATH%\*') do (SET AspNetLoaderPath=%ASPNETLOADER_PACKAGE_BASEPATH%\%%j\tools\AspNet.Loader.dll) -echo Found AspNetLoader.dll at %AspNetLoaderPath%. Copying to bin\ -copy %AspNetLoaderPath% bin\ \ No newline at end of file diff --git a/src/BugTracker/Helios.cmd b/src/BugTracker/Helios.cmd deleted file mode 100644 index b110923..0000000 --- a/src/BugTracker/Helios.cmd +++ /dev/null @@ -1,6 +0,0 @@ -SET DNX_HOME=%USERPROFILE%\.dnx\ - -REM copy the AspNet.Loader.dll to the bin folder -call CopyAspNetLoader.cmd - -"%ProgramFiles(x86)%\iis Express\iisexpress.exe" /port:5001 /path:"%cd%" diff --git a/src/BugTracker/Model/BugsRepository.cs b/src/BugTracker/Model/BugsRepository.cs index 1b5d237..f9eb7b1 100644 --- a/src/BugTracker/Model/BugsRepository.cs +++ b/src/BugTracker/Model/BugsRepository.cs @@ -11,7 +11,7 @@ namespace BugTracker.Model _repo = new List(); //add some default values - _repo.Add(new Bug { id = 1, title = "bug #1", description = "first bug", state = "backlog"}); + _repo.Add(new Bug { id = 1, title = "bug #1", description = "first bug", state = "backlog" }); _repo.Add(new Bug { id = 2, title = "bug #2", description = "second bug", state = "working" }); _repo.Add(new Bug { id = 3, title = "bug #3", description = "third bug", state = "done" }); _repo.Add(new Bug { id = 4, title = "bug #4", description = "fourth bug", state = "backlog" }); diff --git a/src/BugTracker/Program.cs b/src/BugTracker/Program.cs deleted file mode 100644 index 66cd431..0000000 --- a/src/BugTracker/Program.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNet.Hosting; -using Microsoft.Framework.ConfigurationModel; -using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.DependencyInjection.Fallback; - -namespace BugTracker -{ - /// - /// This demonstrates how the application can be launched in a K console application. - /// k run command in the application folder will invoke this. - /// - public class Program - { - private readonly IServiceProvider _hostServiceProvider; - - public Program(IServiceProvider hostServiceProvider) - { - _hostServiceProvider = hostServiceProvider; - } - - public Task Main(string[] args) - { - //Add command line configuration source to read command line parameters. - var config = new Configuration(); - config.AddCommandLine(args); - - var serviceCollection = HostingServices.Create(_hostServiceProvider); - var services = serviceCollection.BuildServiceProvider(); - - var context = new HostingContext() - { - Services = services, - Configuration = config, - ServerName = "Microsoft.AspNet.Server.WebListener", - ApplicationName = "BugTracker" - }; - - var engine = services.GetService(); - if (engine == null) - { - throw new Exception("TODO: IHostingEngine service not available exception"); - } - - using (engine.Start(context)) - { - Console.WriteLine("Started the server.."); - Console.WriteLine("Press any key to stop the server"); - Console.ReadLine(); - } - return Task.FromResult(0); - } - } -} \ No newline at end of file diff --git a/src/BugTracker/Startup.cs b/src/BugTracker/Startup.cs index d5f449b..caed6fb 100644 --- a/src/BugTracker/Startup.cs +++ b/src/BugTracker/Startup.cs @@ -1,13 +1,9 @@ using Microsoft.AspNet.Builder; -using Microsoft.Framework.DependencyInjection; -using Microsoft.AspNet.Diagnostics; -using Microsoft.AspNet.Routing; -using Microsoft.Framework.ConfigurationModel; +using Microsoft.AspNet.Hosting; +using Microsoft.Extensions.DependencyInjection; public class Startup { - public IConfiguration Configuration { get; private set; } - public void ConfigureServices(IServiceCollection services) { // Add MVC services to the services container @@ -17,12 +13,14 @@ public class Startup services.AddSignalR(); } - public void Configure(IApplicationBuilder app) + public void Configure(IApplicationBuilder app, IHostingEnvironment env) { - /* Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the request pipeline. - * Note: ErrorPageOptions.ShowAll to be used only at development time. Not recommended for production. - */ - app.UseErrorPage(ErrorPageOptions.ShowAll); + if (env.IsDevelopment()) + { + /* Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the request pipeline. + */ + app.UseDeveloperExceptionPage(); + } //Configure SignalR app.UseSignalR(); @@ -30,7 +28,7 @@ public class Startup //Serves static files in the application. app.UseFileServer(); - //Configure WebFx + // Configure MVC app.UseMvc(routes => { routes.MapRoute( @@ -49,4 +47,14 @@ public class Startup new { controller = "Home" }); }); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } diff --git a/src/BugTracker/Web.Debug.config b/src/BugTracker/Web.Debug.config deleted file mode 100644 index 2e302f9..0000000 --- a/src/BugTracker/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/BugTracker/Web.Release.config b/src/BugTracker/Web.Release.config deleted file mode 100644 index c358444..0000000 --- a/src/BugTracker/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/BugTracker/Web.config b/src/BugTracker/Web.config deleted file mode 100644 index ed90fec..0000000 --- a/src/BugTracker/Web.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/BugTracker/api/BugsController.cs b/src/BugTracker/api/BugsController.cs index deb47c8..6446007 100644 --- a/src/BugTracker/api/BugsController.cs +++ b/src/BugTracker/api/BugsController.cs @@ -1,10 +1,10 @@ -using BugTracker.Hubs; +using System.Collections.Generic; +using System.Linq; +using BugTracker.Hubs; using BugTracker.Model; using Microsoft.AspNet.Mvc; using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR.Infrastructure; -using System.Collections.Generic; -using System.Linq; namespace BugTracker.api { @@ -18,8 +18,8 @@ namespace BugTracker.api { _hub = connectionManager.GetHubContext(); } - - [HttpGet("~/api/bugs")] + + [HttpGet("~/api/bugs")] public IEnumerable Get() { return _bugsRepository.GetBugs(); diff --git a/src/BugTracker/hosting.json b/src/BugTracker/hosting.json new file mode 100644 index 0000000..9550537 --- /dev/null +++ b/src/BugTracker/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/src/BugTracker/project.json b/src/BugTracker/project.json index cc66326..6babe0d 100644 --- a/src/BugTracker/project.json +++ b/src/BugTracker/project.json @@ -1,27 +1,23 @@ { - "authors": [ - "Microsoft" - ], - "description": "BugTracker application on K", - "version": "1.0.0-*", - "packExclude": "*.cmd", - "webroot": "wwwroot", - "dependencies": { - "Kestrel": "1.0.0-*", - "Microsoft.AspNet.Server.IIS": "1.0.0-*", - "Microsoft.AspNet.Mvc": "6.0.0-*", - "Microsoft.AspNet.Server.WebListener": "1.0.0-*", - "Microsoft.AspNet.Diagnostics": "1.0.0-*", - "Microsoft.AspNet.StaticFiles": "1.0.0-*", - "Microsoft.AspNet.SignalR.Server": "3.0.0-*" - }, - "commands": { - "WebListener": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5002", - "Kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004", - "run": "run server.urls=http://localhost:5003" - }, - "frameworks": { - "dnx451": { }, - "dnxcore50": { } - } + "authors": [ "Microsoft" ], + "description": "BugTracker application on ASP.NET 5", + "version": "1.0.0-*", + "packExclude": "*.cmd", + "compilationOptions": { + "emitEntryPoint": true + }, + "dependencies": { + "Microsoft.AspNet.Diagnostics": "1.0.0-*", + "Microsoft.AspNet.Mvc": "6.0.0-*", + "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", + "Microsoft.AspNet.SignalR.Server": "3.0.0-*", + "Microsoft.AspNet.StaticFiles": "1.0.0-*" + }, + "commands": { + "web": "Microsoft.AspNet.Server.Kestrel" + }, + "frameworks": { + "dnx451": { }, + "dnxcore50": { } + } } diff --git a/src/BugTracker/wwwroot/web.config b/src/BugTracker/wwwroot/web.config new file mode 100644 index 0000000..9a0d90a --- /dev/null +++ b/src/BugTracker/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file