Git Product home page Git Product logo

dotnetcorewebvs's Introduction

Project Creation

From command line, this project's equivalent could have been created with dotnet new -t web

This project was created in Visual Studio-> add -> New Project-> .NET core -> Empty

Configuration

Change Server Port

  • In Program.cs, change the value of the following code for kestrel server

.UseUrls("http://localhost:8081");

  • In Properties\launchSettings.json, change the following line to allow Visual Studio to launch new port:

"launchUrl": "http://localhost:8081",

Change Environment name:

  • In Properties\launchSettings.json, change the following:

"environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Stage" }

Configuration Key Value Pair

  • In appsettings.json, we can add key value pairs as needed
  • In Startup.cs, we hookup the Configuration Provider in the constructor

Configuration = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json") .Build();

  • Note that we also needed the following in project.json" "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final"

Sample Functionality

Static Files

  • Make sure in Startup.cs, the following code is uncommented:

app.UseStaticFiles();

Directory Browsing

  • In Startup.cs, make sure the following code is uncommented: app.UseDirectoryBrowser();
  • go to http://localhost:8081
  • Expect to see the directory listing.

Updating Packages

  • Go to SampleLibrary folder and run

dotnet pack

  • Copy the generated files from bin folder to packages folder
  • One time: Add the packages folder to nuget sources settings.
  • Update nuget packages

Routing

The following URLs are being handled by the routing middleware

dotnetcorewebvs's People

Contributors

vijayvepa avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.