Giter Club home page Giter Club logo

templates's Introduction

.NET Core ServiceStack Templates for dotnet new

This repository contains the latest templates for working with ServiceStack on .NET Core.

Installation

Currently the latest version of the .NET Core CLI/SDK will require the cloning of this repository for installation, in the future, dotnet new will allow installation of these templates via a NuGet package ServiceStack.Core.Templates. It also assumes you have a git client installed as well as the .NET Core CLI. For now, to install these templates you will need to do the following.

  • git clone https://github.com/NetCoreApps/templates.git {LocalTempPath}
  • dotnet new -i {LocalTempPath}\templates\src\content

For example, if you are on Windows with a Temp directory, the following script should work.

git clone https://github.com/NetCoreApps/templates.git c:\Temp
dotnet new -i c:\Temp\templates\src\content

If you are on Ubuntu/Debian, the following should work.

git clone https://github.com/NetCoreApps/templates.git /tmp
dotnet new -i /tmp/templates/src/content

To confirm the templates are installed correctly, type dotnet new into a console and you should see the 3 ServiceStack Core templates listed.

Create a new project

If you want to use the ss-empty template now installed, you can use the following command to create a new project with the name MyApp in it's own directory.

dotnet new ss-empty -o MyApp -n MyApp

The -o argument controls the output directory name and -n controls the name of the template. If neither are provided a default WebApplication1 project will be created within the current directory of the cli.

Opening the created MyApp.sln file with VS2017 and running with the default IIS Express will result in a working ServiceStack app on .NET Core.

ServiceStack with MVC

Also included in the templates is an MVC .NET Core 1.1 application ready to run!

Running a ss-selfhost

If you going to create a new SelfHost using the ss-selfhost template and run it with Visual Studio 2017, remember to switch from the default IIS Express in the run drop-down to MyApp. The IIS Express run won't work as the SelfHost template don't include the .UseIISIntegration() in the StartUp process.

templates's People

Contributors

layoric avatar mythz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

templates's Issues

The ss-empty project won't build

To build and run the ss-empty project I had to remove and recreate the test project.
The test project referenced an older version of .netcore. But I could not upgrade it. I got the message "Blocked by project" in the nuget manager.

Failing to produce usable nupkg due to some NetCoreTemplates having dlls

Leaving this here as a reminder after a few hours of debugging why dotnet new -i .\{nuget package file} no longer worked.

Projects rockwind-webapp and parcel_webapp contain embedded dlls which cause dotnet new -i (install) to fail silently. Removing those 2 from the content directory allow others to be installed correctly and show up in VS + Rider as expected.

image

image

Simple approach to start will be maintaining a exclude list of template names that won't work as packaged templates due to limitation of distributing dlls as content in NuGet packages and the fact that it will break cross platform.

Error in create new project command.

I think the command to create a new ss-empty project should be:
dotnet new ss-empty -o MyApp -n MyApp
not
dotnet new -i ss-empty -o MyApp -n MyApp

The "-i" seems to be causing trouble.

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.