stepanbenes / api-for-nopcommerce

API plugin for nopCommerce 4.50
MIT License
141 stars 93 forks source link

api Build with 4 errors #84

Closed ora19982022 closed 9 months ago

ora19982022 commented 1 year ago
  1. api Build with 4 errors.
  2. this api is based on .Net 5.0, so the errors mainly said different .Net version.

so this api is not for NopCommerce 4.5? since I am using NopCommerce 4.5

D3bo commented 1 year ago

This API is based on .net 6.0 (#56) and is fully compatible with NopCommerce 4.5. I'm using this project on multiple sites right now.

Which branch are you using?

ora19982022 commented 1 year ago

I cannot build it with Visual Studio 2022(both 17.4.3 and 17.5.0), not sure if the VS version issue?

ora19982022 commented 1 year ago

I am using Main branch, fyi.

ora19982022 commented 1 year ago

I follow the installation notes, #1/#2/#3 have no problem. but I still cannot build api succecssfully and blocked at #4

This is my folder structure. NopMobileFolderStructure This is my total folde structure: D:\Projects\nopCommerce I put both NopCommerce and API in this folder: D:\Projects\nopCommerce\NopCommerce D:\Projects\nopCommerce\api-for-nopcommerce

This is the structure of NopCommerce. NopStructure

This is the structure of api-for-nopcommerce. ApiStructure

I can build Nopcommerce without problem, but I got errors when I built Api, the errors message is as following:

Errors cannot find the project information “D:\Projects\nopCommerce\nopCommerce\src\Libraries\Nop.Core\Nop.Core.csproj” Errors cannot find the project information “D:\Projects\nopCommerce\nopCommerce\src\Presentation\Nop.Web.Framework\Nop.Web.Framework.csproj”

but I can see above files in the corresponding folders. any idea? thanks in advance.

My Visual Studio is version 2022. I also saw the .net version issue in errors message like: target framework "net5.0" is not supported, wont have security update in the future etc.. “D:\Projects\nopCommerce\nopCommerce\src\Libraries\Nop.Core\Nop.Core.csproj” points to "net7.0" etc..

ora19982022 commented 1 year ago

Fixed the problem, since the .net version is different, NopCommerce 4.5 is using .net sdk verison 6, api is still using .net sdk version 5. fyi.

D3bo commented 1 year ago

As you can see in the project file the API is using the .net version 6.

@stepanbenes am I missing something?

stepanbenes commented 1 year ago

@D3bo You are correct. We are using .NET 6. I misread the comment.

D3bo commented 1 year ago

Indeed I was pretty sure #56 😄

btw we should update the readme.

stepanbenes commented 1 year ago

In the readme there is a reference to ClientApp that still uses .NET 5...

ora19982022 commented 1 year ago

api is still using version 5, that's why build will run into errors. I downloaded NopCommerce V4.50.0 and fixed the problem, they need to keep the same version.

ora19982022 commented 1 year ago

Fixed the problem, since the .net version is different, NopCommerce 4.5 is using .net sdk verison 6, api is still using .net sdk version 5. fyi.

I downloaded NopCommerce V4.50.0 and fixed the problem. fyi.

VFCoder commented 1 year ago

Fixed the problem, since the .net version is different, NopCommerce 4.5 is using .net sdk verison 6, api is still using .net sdk version 5. fyi.

I downloaded NopCommerce V4.50.0 and fixed the problem. fyi.

I'm having the same issue. What did you do exactly to fix it?

VFCoder commented 1 year ago

Fixed the issue by adding the Framework project to the api solution

D3bo commented 9 months ago

Closed, the problem were the use of the wrong version of nopCommerce