{"id":13596945,"url":"https://github.com/soukoku/aspnetcore-vue","last_synced_at":"2026-01-14T06:38:50.773Z","repository":{"id":85039027,"uuid":"134916144","full_name":"soukoku/aspnetcore-vue","owner":"soukoku","description":"Sample setup on using asp.net core 2.1 + vue cli 3 in one project. This sample is deprecated and rolled into https://github.com/soukoku/AspNetCore.SpaServices.VueCli","archived":true,"fork":false,"pushed_at":"2020-07-30T11:02:14.000Z","size":1983,"stargazers_count":34,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-15T05:35:38.368Z","etag":null,"topics":["aspnet","aspnetcore","vue","vuecli","vuejs"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soukoku.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-05-26T00:21:28.000Z","updated_at":"2024-01-26T02:51:44.000Z","dependencies_parsed_at":"2024-01-15T16:52:15.211Z","dependency_job_id":null,"html_url":"https://github.com/soukoku/aspnetcore-vue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/soukoku/aspnetcore-vue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soukoku%2Faspnetcore-vue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soukoku%2Faspnetcore-vue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soukoku%2Faspnetcore-vue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soukoku%2Faspnetcore-vue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soukoku","download_url":"https://codeload.github.com/soukoku/aspnetcore-vue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soukoku%2Faspnetcore-vue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aspnet","aspnetcore","vue","vuecli","vuejs"],"created_at":"2024-08-01T16:02:59.351Z","updated_at":"2026-01-14T06:38:50.755Z","avatar_url":"https://github.com/soukoku.png","language":"Vue","funding_links":[],"categories":["Vue"],"sub_categories":[],"readme":"# aspnetcore-vue\n\nA sample aspnet project template with these features:\n\n* asp.net core 2.1 for server-side code\n* vue.js for client-side code (created with cli v3)\n* both live in one project and debugging is done on the aspnet project\n* working HMR in vue app when debugging the aspnet site\n\nBelow are the steps used to create this.\n\n\n# Aspnet Core Project\nCreate a new dotnet core project with aspnet core template.\n\nThen In `Startup.cs`, add\n`services.AddSpaStaticFiles()` in `ConfigureServices()` method,\nand `app.UseSpaStaticFiles()` and `app.UseSpa()` in `Configure()` method.\n\n\n```cs\npublic void ConfigureServices(IServiceCollection services)\n{\n  services.AddMvc();\n\n  // new addition here\n  services.AddSpaStaticFiles(spa =\u003e\n  {\n    spa.RootPath = @\"ClientApp\\dist\";\n  });\n}\n\npublic void Configure(IApplicationBuilder app, IHostingEnvironment env)\n{\n  // ... other aspnet configuration skipped here\n\n  app.UseStaticFiles();\n  app.UseSpaStaticFiles(); // new addition\n  app.UseMvc();\n\n  // new addition\n  app.UseSpa(spa =\u003e\n  {\n    if (env.IsDevelopment())\n    {\n      // change this to whatever webpack dev server says it's running on\n      spa.UseProxyToSpaDevelopmentServer(\"http://localhost:8080\");\n    }\n  });\n}\n```\n\n# Vue Project\nCreate a client-side project using vue cli 3 \ninto a folder called ClientApp in the aspnet project folder.\n\n\n\n# Csproj File\nSome edits to the .csproj file are also needed for proper \nrelease/publish using dotnet.\n\nThe `PropertyGroup` defines a new variable `SpaRoot` for use later.\n\nThe `ItemGroup` makes vue's project folder visible in VS\nbut not include in build.\n\n`DebugEnsureNodeEnv` target installs npm packages if necessary\non project builds.\n\n`PublishRunWebpack` target builds the vue app and \ninclude the **dist** folder in the published files.\n\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk.Web\"\u003e\n\n  \u003c!-- ...default stuff skipped here... --\u003e\n\n  \u003cPropertyGroup\u003e\n    \u003cSpaRoot\u003eClientApp\\\u003c/SpaRoot\u003e\n  \u003c/PropertyGroup\u003e\n\n  \u003cItemGroup\u003e\n    \u003cContent Remove=\"$(SpaRoot)**\" /\u003e\n    \u003cNone Include=\"$(SpaRoot)**\" Exclude=\"$(SpaRoot)dist\\**\" /\u003e\n  \u003c/ItemGroup\u003e\n  \n  \u003cTarget Name=\"DebugEnsureNodeEnv\" BeforeTargets=\"Build\" Condition=\" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') \"\u003e\n    \u003c!-- Ensure Node.js is installed --\u003e\n    \u003cExec Command=\"node --version\" ContinueOnError=\"true\"\u003e\n      \u003cOutput TaskParameter=\"ExitCode\" PropertyName=\"ErrorCode\" /\u003e\n    \u003c/Exec\u003e\n    \u003cError Condition=\"'$(ErrorCode)' != '0'\" Text=\"Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE.\" /\u003e\n    \u003cMessage Importance=\"high\" Text=\"Restoring dependencies using 'npm'. This may take several minutes...\" /\u003e\n    \u003cExec WorkingDirectory=\"$(SpaRoot)\" Command=\"npm install\" /\u003e\n  \u003c/Target\u003e\n\n  \u003cTarget Name=\"PublishRunWebpack\" AfterTargets=\"ComputeFilesToPublish\"\u003e\n    \u003c!-- As part of publishing, ensure the JS resources are freshly built in production mode --\u003e\n    \u003cExec WorkingDirectory=\"$(SpaRoot)\" Command=\"npm install\" /\u003e\n    \u003cExec WorkingDirectory=\"$(SpaRoot)\" Command=\"npm run build\" /\u003e\n\n    \u003c!-- Include the newly-built files in the publish output --\u003e\n    \u003cItemGroup\u003e\n      \u003cDistFiles Include=\"$(SpaRoot)dist\\**\" /\u003e\n      \u003cResolvedFileToPublish Include=\"@(DistFiles-\u003e'%(FullPath)')\" Exclude=\"@(ResolvedFileToPublish)\"\u003e\n        \u003cRelativePath\u003e%(DistFiles.Identity)\u003c/RelativePath\u003e\n        \u003cCopyToPublishDirectory\u003ePreserveNewest\u003c/CopyToPublishDirectory\u003e\n      \u003c/ResolvedFileToPublish\u003e\n    \u003c/ItemGroup\u003e\n  \u003c/Target\u003e\n\u003c/Project\u003e\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoukoku%2Faspnetcore-vue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoukoku%2Faspnetcore-vue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoukoku%2Faspnetcore-vue/lists"}