spboyer / cleanshave

ASP.NET Core (RC1) and Angular 2 SPA Template
121 stars 123 forks source link

Can't open with VS2015 #15

Open ManuelDeLeon opened 8 years ago

ManuelDeLeon commented 8 years ago

I can get it working from the command line (npm start) but when I open the project with Visual Studio I'm in a world of hurt.

Out the bat it tries to update the dependencies but fails:

PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git;c:\Program Files\nodejs
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\Bower.cmd" install --force-latest
bower jquery-validation-unobtrusive#3.2.4           cached https://github.com/aspnet/jquery-validation-unobtrusive.git#3.2.4
bower jquery-validation-unobtrusive#3.2.4         validate 3.2.4 against https://github.com/aspnet/jquery-validation-unobtrusive.git#3.2.4
bower jquery-validation#1.14.0                      cached https://github.com/jzaefferer/jquery-validation.git#1.14.0
bower jquery-validation#1.14.0                    validate 1.14.0 against https://github.com/jzaefferer/jquery-validation.git#1.14.0
bower bootstrap#3.3.5                               cached https://github.com/twbs/bootstrap.git#3.3.5
bower bootstrap#3.3.5                             validate 3.3.5 against https://github.com/twbs/bootstrap.git#3.3.5
bower jquery#2.1.4                                  cached https://github.com/jquery/jquery-dist.git#2.1.4
bower jquery#2.1.4                                validate 2.1.4 against https://github.com/jquery/jquery-dist.git#2.1.4
bower jquery#2.1.4                                 install jquery#2.1.4
bower                                              skipped jquery was not installed because there is already a non-bower directory with that name in the components directory (wwwroot\lib\jquery). You can force installation with --force.
bower jquery-validation-unobtrusive#3.2.4          install jquery-validation-unobtrusive#3.2.4
bower jquery-validation#1.14.0                     install jquery-validation#1.14.0
bower bootstrap#3.3.5                              install bootstrap#3.3.5
bower                                              skipped bootstrap was not installed because there is already a non-bower directory with that name in the components directory (wwwroot\lib\bootstrap). You can force installation with --force.
jquery#2.1.4 ..\..\..\Users\manuel.de.leon\AppData\Local\bower\cache\packages\35300e45e44dbc6f186ed069533ef0af\2.1.4
jquery-validation-unobtrusive#3.2.4 wwwroot\lib\jquery-validation-unobtrusive
├── jquery#2.1.4
└── jquery-validation#1.14.0
jquery-validation#1.14.0 wwwroot\lib\jquery-validation
└── jquery#2.1.4
bootstrap#3.3.5 ..\..\..\Users\manuel.de.leon\AppData\Local\bower\cache\packages\478ab1d28ba78f550601bf536eea62f5\3.3.5
└── jquery#2.1.4

image

If I try to build the project I get:

1>------ Build started: Project: cleanshave, Configuration: Debug Any CPU ------
1>node_modules\angular2\platform\browser.d.ts(77,90): error TS2304: Build: Cannot find name 'Promise'.
1>node_modules\angular2\src\core\application_ref.d.ts(83,60): error TS2304: Build: Cannot find name 'Promise'.
...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

At this point I figure I'm missing a typed file so I add tsd install es6-shim (jasmine too for good measure). I try to build the project and now I get:

1>------ Build started: Project: cleanshave, Configuration: Debug Any CPU ------
1>  C:\Program Files\dotnet\dotnet.exe build "C:\MyFiles\Angular\cleanshave" --configuration Debug --no-dependencies
1>  Project cleanshave (DNX,Version=v4.5.1) will be compiled because expected outputs are missing
1>  Compiling cleanshave for DNX,Version=v4.5.1
1>  Compilation succeeded.
1>      3 Warning(s)
1>      0 Error(s)
1>  Time elapsed 00:00:01.8434519
1>C:\MyFiles\Angular\cleanshave\project.json(38,22): warning DOTNET1015: The 'publishExclude' option is deprecated. Use 'publishOptions' instead.
1>C:\MyFiles\Angular\cleanshave\project.json(33,15): warning DOTNET1015: The 'exclude' option is deprecated. Use 'exclude' within 'compile' or 'embed' instead.
1>C:\MyFiles\Angular\cleanshave\project.json(3,26): warning DOTNET1015: The 'compilationOptions' option is deprecated. Use 'buildOptions' instead.
1>
1>  Project cleanshave (DNXCore,Version=v5.0) will be compiled because expected outputs are missing
1>  Compiling cleanshave for DNXCore,Version=v5.0
1>C:\MyFiles\Angular\cleanshave\project.json(38,22): warning DOTNET1015: The 'publishExclude' option is deprecated. Use 'publishOptions' instead.
1>C:\MyFiles\Angular\cleanshave\project.json(33,15): warning DOTNET1015: The 'exclude' option is deprecated. Use 'exclude' within 'compile' or 'embed' instead.
1>C:\MyFiles\Angular\cleanshave\project.json(3,26): warning DOTNET1015: The 'compilationOptions' option is deprecated. Use 'buildOptions' instead.
1>  Compilation succeeded.
1>      3 Warning(s)
1>      0 Error(s)
1>  Time elapsed 00:00:01.7300023
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(241,5): error : Failed to make the following project runnable: cleanshave (DNXCore,Version=v5.0) reason: Expected coreclr library not found in package graph. Please try running dotnet restore again.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Key point as I see it: Expected coreclr library not found in package graph. Please try running dotnet restore again.

At this point I don't know what to do because I'm pretty sure I shouldn't run dotnet restore... but I do it anyway and the project now breaks even in the console.

/help

MartinJohns commented 8 years ago

Expected coreclr library not found in package graph. Please try running dotnet restore again.

This mentions dotnet restore, and in the error list we see a lot of warnings mentioning deprecated options. Did you install the recent .NET Core RC2 tooling?

The newest tooling (for RC2) uses RC2 by default. But this project is based on RC1. In order for the tooling to use RC1 you need to have a global.json present, which does not exist in this project.

Check out this: https://blogs.msdn.microsoft.com/visualstudio/2016/05/16/announcing-updated-web-development-tools-for-asp-net-core-rc2/ Specifically the section "Support for RC1 and RC2 projects".

JeffJacobson commented 7 years ago

To work around the bower error, you can run bower install --force.

When a Visual Studio project includes bower folders, it creates empty folders before running bower install which causes this error. (I actually came across this GitHub issue by searching for a better solution that doesn't require the developer to use --force, which I haven't found yet 😿 )

endyprekpalaj commented 6 years ago

What worked for me was I deleted bootstrap and jQuery folders in my wwwroot folder, and then in my Bower folder right click each one and select "Restore package". Using VS2017.