microsoft / PartsUnlimited

.Net Core + SQL Azure app for DevOps Scenarios
https://microsoft.github.io/PartsUnlimited/
MIT License
667 stars 1.53k forks source link

Build is giving error #177

Open prasadtsnv opened 5 years ago

prasadtsnv commented 5 years ago

As per steps provided for visual studio set-up(http://microsoft.github.io/PartsUnlimited/pandp/200.1x-PandP-PUsetupwithVS2017.html), clicked on PartsUnlimited.sln file after cloning from Git. It's giving below error.

D:\Study\DevOps\PartsUnlimited\src\PartsUnlimitedWebsite\PartsUnlimitedWebsite.csproj : error : Project file is incomplete. Expected imports are missing.

D:\Study\DevOps\PartsUnlimited\test\PartsUnlimited.UnitTests\PartsUnlimited.UnitTests.csproj : error : Project file is incomplete. Expected imports are missing.

D:\Study\DevOps\PartsUnlimited\src\PartsUnlimited.Models\PartsUnlimited.Models.csproj : error : Project file is incomplete. Expected imports are missing.

D:\Study\DevOps\PartsUnlimited\src\PartsUnlimited.WebJobs.ProcessOrder\PartsUnlimited.WebJobs.ProcessOrder.csproj : error : Project file is incomplete. Expected imports are missing.

D:\Study\DevOps\PartsUnlimited\src\PartsUnlimited.WebJobs.UpdateProductInventory\PartsUnlimited.WebJobs.UpdateProductInventory.csproj : error : Project file is incomplete. Expected imports are missing.

eamonnk commented 5 years ago

Hi,

We're looking at this at the moment, will get back shortly on it. It may be a day or so.

Thanks, Eamonn

mjanulaitis commented 5 years ago

I cloned the latest and am getting assembly reference errors. It appears that several required NuGet packages are not listed in the project file:

4>Functions.cs(9,17,9,29): error CS0234: The type or namespace name 'WindowsAzure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 4>Functions.cs(19,69,19,79): error CS0246: The type or namespace name 'CloudQueue' could not be found (are you missing a using directive or an assembly reference?) 5>Functions.cs(8,17,8,36): error CS0234: The type or namespace name 'EntityFrameworkCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 4>Functions.cs(19,52,19,57): error CS0246: The type or namespace name 'QueueAttribute' could not be found (are you missing a using directive or an assembly reference?) 4>Functions.cs(19,52,19,57): error CS0246: The type or namespace name 'Queue' could not be found (are you missing a using directive or an assembly reference?) 4>Done building project "PartsUnlimited.WebJobs.ProcessOrder.csproj" -- FAILED.

mjanulaitis commented 5 years ago

After adding the following NuGet packages:

Microsoft.AspNetCore.Identity.EntityFrameworkCore Microsoft.Azure.WebJobs.Extensions.Storage Microsoft.EntityFrameworkCore

I get:

5>Program.cs(33,37,33,57): error CS0246: The type or namespace name 'JobHostConfiguration' could not be found (are you missing a using directive or an assembly reference?) 5>Program.cs(34,28,34,35): error CS7036: There is no argument given that corresponds to the required formal parameter 'jobHostContextFactory' of 'JobHost.JobHost(IOptions, IJobHostContextFactory)' 5>Program.cs(36,18,36,29): error CS1061: 'JobHost' does not contain a definition for 'RunAndBlock' and no accessible extension method 'RunAndBlock' accepting a first argument of type 'JobHost' could be found (are you missing a using directive or an assembly reference?)

kevchant commented 5 years ago

Any luck wit a fix yet, as having same issue?

mjanulaitis commented 5 years ago

Sorry no luck. I moved on since the sample is out of date.

kevchant commented 5 years ago

Well I'll wait and if anybody gets a chance to fix it, as been waiting a while to find the time to use it.

eamonnk commented 5 years ago

Hi,

An update has been pushed out to fix this, so it's building now in vs2017. The cause was related to the .NET Core 2.2 update and dependencies on legacy packages.

So the app is building and deploying successfully now in AzDev and also locally in VS2017. If anyone still encounters problems let us know.

Thanks, Eamonn

mjanulaitis commented 5 years ago

Thank you for the prompt action. I have pulled and verified the code compiles.

kevchant commented 5 years ago

I'm still seeing the same issue, I got an older version to work but paranoid I will miss something...

eamonnk commented 5 years ago

Hi ,

I ran through this again this morning and its building successfully for me.

To make sure it was a clean environment I did the following

  1. deployed a Win10 VM with VS2017 to Azure
  2. updated to latest VS2017 version via Tools > extensions and updates in VS (that updated Vs to ver 15.9)
  3. Installed .NET Core 2.2 from https://aka.ms/dotnet-download (can check versions installed for sdk and runtime using dotnet --info cnd)
  4. then followed the steps from the lab PartsUnlimited Setup with Visual Studio, you may have to restart after installing node.js, but don't think there was anything else done otside of whats in these steps.
  5. The Partsunlimitedwebsite sln then loaded fine in VS2017, and all slns built successfully.
  6. The Partsunlimitedwebsite solution then also published fine to Azure App services from within VS2017.

Can you check, you have the latest repo files, and also perhaps the .NET Core versions available, is .NET Core 2.2 sdk installed? and also if you have a specific error mesaage that you are seeing can you share that also?

Another approach could be to also build in a clean VM environment. It might be an idea to modify the lab to script the deployment and config of the environment,to try help eliminate local buld issues and give a consistent enviroment, we'll have a look at that.

Thanks, Eamonn

kevchant commented 5 years ago

Eamonn

I installed latest .NET 2.2 installs which improved the situation. Only outstanding issue after that was a dependency error which I fixed by running the below in the PartsUnlimitedWebsite folder:

npm install grunt-sass

All seems well now, thanks.

Kevin

eamonnk commented 5 years ago

Great Kevin, glad you could get it going.

We'll update the steps in the lab to call out installing the .NET Core 2.2

Thanks Again, Eamonn

eamonnk commented 5 years ago

Hi,

Just FYI that the lab steps have been updated to reflect the .NET Core 2.2 installation requirement, on the page PartsUnlimited Setup with Visual Studio

Thanks, Eamonn