I am using Core+Angla v5.0.4. Just now, after updating my VS2017 to version 15.6.6 and reopen VS, many projects disappeared, and many build-errors pupup. Most errors like:
Error NU1105 Unable to find project information for 'C:\MyPrj\aspnet-core\src\MyPrj.Web.Core\MyPrj.Web.Core.csproj'. The project file may be invalid or missing targets required for restore. MyPrj.Web.Host C:\MyPrj\aspnet-core\src\MyPrj.Web.Host\MyPrj.Web.Host.csproj
and
Error CS0012 The type 'AbpController' is defined in an assembly that is not referenced. You must add a reference to assembly 'Abp.AspNetCore, Version=3.2.5.0, Culture=neutral, PublicKeyToken=null'. SNet.Web.Host C:\MyPrj\aspnet-core\srcMyPrj.Web.Host\Controllers\AntiForgeryController.cs
Do you have any idea about restoring?
Thanks,
5 Answer(s)
-
0
Run dotnet restore in the command prompt from the directory of your .sln file.
-
0
Thank you for your advice. I tried it but seems no help.
The aspnet-core folder has 3 .sln files. I have to run "dotnet restore *.Web.sln". It runs with several same NU1603 warning, "... Newtonsoft.Json 5.0.0 was not found. An approximate best match of Newtonsoft.Json 5.0.1 was resolved."
After run this command, I tried to open the *.Web.sln in VS2017. Same thing happends. The src folder only shows 5 projects: Application.Shared, Core.Shared, EntityFrameworkCore, Web.Host, and Web.Public.
I tried to build solution in VS2017 but got much more errors.
Any suggestion?
Thanks,
-
0
Stop running your application instances. Close Visual Studio . Delete all BIN & OBJ folders.
PS: There are many bin & obj folders. And it's time consuming to delete all. You can use my batch file to delete them all. Just put this within the same folder with *.sln files. [attachment=0:8n08j5rg]Click here to download -Delete BIN OBJ Folders.rar-[/attachment:8n08j5rg] Delete BIN OBJ Folders.rar
-
0
Thank you for your solution! The bat file is very helpful. I run it but does not solve the problem. There are still some projects missed in VS, and showing "restoring failed" with errors around some .csproj files.
As I dug out, the missed projects are not included in web.sln. This may be the root of the issue. Not sure if it is related to the VS update for v15.6.6. The web.sln file seems modified just after the update time.
I deleted that web.sln, copied/pasted a web.sln from old backup, run "Delete BIN OBJ Folders.bat", and opened it in VS again. It succeeds this time. There are still some warnings:
Warning NU1603 Hangfire.Core 1.6.17 depends on Newtonsoft.Json (>= 5.0.0) but Newtonsoft.Json 5.0.0 was not found. An approximate best match of Newtonsoft.Json 5.0.1 was resolved.
Warning MSB3245 Could not resolve this reference. Could not locate the assembly "System.ComponentModel.DataAnnotations". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
There is no running problem so far, as my testing. Shall I do something to resolve these warnings, or just ignore them?
Thanks again!
-
0
Just ignore it.