Open JasonWeiseUnreal opened 8 years ago
I guess this project is inspired by https://github.com/kriasoft/react-static-boilerplate. And the .NET Core server was just added as a sub-folder. This is supported in Visual Studio Code, but not in Visual Studio 2015 AFAIK.
I've successfully changed the project to be able to run in Visual Studio 2015. Here is a guide.
Configure Visual Studio
Change project Do this before opening the project in Visual Studio 2015 the first time.
To run there is a two options:
NPM/Node
npm install
. In VS you can right click > Run on install in NPM Task Runner.npm start
- again you can right click start > Run on start in NPM Task Runner. Now everything should work with hotreload and everything.IIS Express If you don't want to use Node as webserver, you can use webpack directly
webpack
. You can right click > Run on "Run - Developent" in Webpack task runner .This also works... but without hot reload... take a look here. Also you should consider running Webpack in watch mode.
As an update to this incredibly helpful post by @tjementum , it should be noted that the project.json file will be replaced by csproj in a near future update. So wouldn't get to deep into the project.json issue.
Also, you can keep the server code in the server folder, you don't have to move all of it up one dir. You just have to move the project.json and appsettings.json which appears to be hardcoded as a path. And so don't delete the global.json in this case either (to map to your Server folder). The rest is spot on required.
I ended up changing some things to improve it.. The project.json now has:
"scripts": {
"prebuild": [
"node run build"
],
}
since in visual studio the .vscode tasks.json doesn't do anything. Also had to edit the build pre-op (run.js):
tasks.set('build', () => {
global.DEBUG = process.argv.includes('--debug') || false;
return Promise.resolve()
.then(() => run('clean'))
.then(() => run('bundle'));
// removed copy (as if it's already in wwwroot, whats the point)
// removed appsettings since I also removed the promise call for msbuild. Since ms handles it fine.
});
And also edit project.json to support the paths..
"publishOptions": {
"include": [
"ServerSide/Views",
"ServerSide/**/*.cshtml",
"wwwroot",
],
"includeFiles": [
"ServerSide/appsettings.json",
"ServerSide/appsettings.Production.json",
"ServerSide/web.config"
],
"mappings": {
"ServerSide": "./**/*",
}
},
If you have all of your paths correct in the edited json files, everything should be happy. You can hit build from vstudio and it'll run everything proper.
I'll update more if I end up making any significant milestones, but the above guide really sets you up well.
Edit: See here: http://angularfirst.com/asp-net-core-migrating-to-msbuild/ and here: https://docs.microsoft.com/en-us/dotnet/articles/core/preview3/tools/dotnet-migrate
Edit2:
I ended up doing a total conversion of the project for visual studio. If anyone is interested in the source for that I'll see about making a fork. Till then...
A fork could be useful.
Just to add to this - I did create a fork here using the steps supplied by @tjementum above
https://github.com/codingupastorm/aspnet-starter-kit-vs-2015
Does anyone know a tidy way to import / create this in Visual Studio 2015. At work we use VS2015 Enterprise and am unable to download VS Code.
I have tried "New Project from Existing files" but you cannot select a ASP.NET core project type and any other type has trouble with dependencies (even after manually running npm install)
I whipped out my personal laptop and installed VS Core and it worked fine, just cannot find a way to open it in Visual Studio 2015, any ideas ?
Thanks in advance.