How to build-run vNext application from Windows Powershell? How to build-run vNext application from Windows Powershell? powershell powershell

How to build-run vNext application from Windows Powershell?


Your problem is related to nuget configuration.

To see the way it works go to your project.json folder and do a "kpm restore". you will see:

Unable to locate System.Console >= 4.0.0.0

This happends because the kpm uses a different nugget repository namely: https://www.myget.org/F/aspnetvnext/

That repository has no nuget package for System.Console

To solve this you need a NuGet.Config file just outside your project.json folder in which you will specify the standard nuget repository (to get the System.Console package) and the asp.net vnext repository so you can get the asp.net vnext specific repositories.

That file should look something like this:

<?xml version="1.0" encoding="utf-8"?><configuration>  <packageSources>    <add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/" />    <add key="NuGet.org" value="https://nuget.org/api/v2/" />  </packageSources>  <packageSourceCredentials>    <AspNetVNext>      <add key="Username" value="aspnetreadonly" />      <add key="ClearTextPassword" value="4d8a2d9c-7b80-4162-9978-47e918c9658c" />    </AspNetVNext>  </packageSourceCredentials></configuration>

Also look out for your folder structure:

/ - root folder- NuGet.config- your project folder-- project.json-- source code files

After you have created the folder structure as exemplified and put the NuGet.config in the right place you do a "kpm restore" and you will see that System.Console is resolved and then issuing "kpm build" all is building correctly


If you're still having this issue, and I was under 10.10, try changing your project.json file to this:

"dependencies": {  "System.Console": "4.0.0-beta-22210"},

(mind you, that will have to be updated as System.Console is changed, but at least you'll be able to compile today).