andrewlock / asp-dot-net-core-in-action

Source code examples for ASP.NET Core in Action
MIT License
208 stars 122 forks source link

Can't load the solution using 2017 Version 15.7.4 and the latest version of Core 2.1.201 #1

Closed WayneHuntley closed 6 years ago

WayneHuntley commented 6 years ago

Hello, great book!!! But, I can't download these examples and run them. The exception is Project File incomplete. Expected imports are missing. I can run your code if I create a new project and move your code into it. Just wondering if you have had this issue and found a solution? I thought it might be because I don't have any earlier versions of .net core on my PC. Just 2.1.201. I'm going to guess it has something to do with the older references in you project file ValidatingWithDataAnnotions.

In any case the book is fantastic. Thank you,

Wayne

andrewlock commented 6 years ago

Hi @WayneHuntley - thanks so much, glad you're enjoying it! It's very possible to do with not having earlier versions of .NET Core on your PC, so good guess 🙂

Could you try deleting the global.json file in the root directory? That file enforces that you have a 2.0.0 version of the SDK installed, which you don't (and shouldn't need).

Basically that file shouldn't be there - I just want to double check that removing it fixes your problem.

Andrew

WayneHuntley commented 6 years ago

Thank you Andrew,

I'll give that a try. I didn't realize the global.json folder would effect everything in the chapter child folders when I'm running the project directly from the chapter folder. Wow! That did the trick!

Thanks again and keep up the good work.

Wayne


From: "Andrew Lock" notifications@github.com Sent: Saturday, September 22, 2018 6:50 AM To: "andrewlock/asp-dot-net-core-in-action" asp-dot-net-core-in-action@noreply.github.com Cc: "WayneHuntley" Wayne@whuntley.com, "Mention" mention@noreply.github.com Subject: Re: [andrewlock/asp-dot-net-core-in-action] Can't load the solution using 2017 Version 15.7.4 and the latest version of Core 2.1.201 (#1)

Hi @WayneHuntley - thanks so much, glad you're enjoying it! It's very possible to do with not having earlier versions of .NET Core on your PC, so good guess ??

Could you try deleting the global.json file in the root directory? That file enforces that you have a 2.0.0 version of the SDK installed, which you don't (and shouldn't need).

Basically that file shouldn't be there - I just want to double check that removing it fixes your problem.

Andrew

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

andrewlock commented 6 years ago

Great, I'll remove the global.json shortly 🙂

Yeah, the global.json affects everything in child folders. dotnet "walks up" through parent folders until it finds one - if it doesn't find one it just uses the default SDK - i.e. the latest SDK you have installed

WayneHuntley commented 6 years ago

Thank you,

See I even learn something from trying to run your examples LOL :-)

I've read my fair share of tech manuals over the past 30 + years. Your way of explaining the subject really works for me. I've been using Core for the last year building SPA apps. But, it was great to read about Core and get all the details.

Wayne


From: "Andrew Lock" notifications@github.com Sent: Monday, September 24, 2018 6:49 AM To: "andrewlock/asp-dot-net-core-in-action" asp-dot-net-core-in-action@noreply.github.com Cc: "WayneHuntley" Wayne@whuntley.com, "Mention" mention@noreply.github.com Subject: Re: [andrewlock/asp-dot-net-core-in-action] Can't load the solution using 2017 Version 15.7.4 and the latest version of Core 2.1.201 (#1)

Great, I'll remove the global.json shortly ??

Yeah, the global.json affects everything in child folders. dotnet "walks up" through parent folders until it finds one - if it doesn't find one it just uses the default SDK - i.e. the latest SDK you have installed

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

andrewlock commented 6 years ago

Thanks, I really appreciate it 🙂

If you have any other issues running the samples just let me know.