Comments (3)
If you are getting that error saying that it cannot find /Views/Home/Customers.cshtml
then you either have not completed Step 4, as shown in the screenshot below, or you have created a Razor Page instead of a Razor View.
Did you put a @page
at the top of the file contents? If so, remove it.
from cs11dotnet7.
You might find the following useful:
https://github.com/markjprice/cs11dotnet7/blob/main/docs/errata/improvements.md#page-533---building-websites-using-aspnet-core
from cs11dotnet7.
I did manage to get Northwind.Mvc to display the customers for the selected country as indicated in the 7e book. But then I did the tasks in the optional part of the chapter detailed in the GitHub pages. Then after trying out displaying the customers again, I encountered the same unhandled exception of not finding the Customers view in any of the three places indicated. I put a breakpoint in the HomeController.cs code where the HTTpClient is created for Northwind.WebApi. The exception occurred after the response was received from the Northwind.WebApi server (all the customer details were shown on the terminal window for that server). I could only assume that the "model" after being processed by the ".ReadFromJsonAsync<IEnumerable>()" did not somehow fit with the structure of the Customers.cshtml file. I then checked the Customers.cshtml file character by character with the code in the repository compared to my code - to no avail. Eventually I decided to replace the code in my file with the repository version of the Customers.cshtml and Northwind.Mvc.csproj files using cut and paste of the complete files. This seems to have cleared the problem. It may be possible that my Customers.cshtml file may have had some hidden character in it which effectively corrupted the file. This seems to be the only explanation for the exception occurring even though I spent many hours comparing my code with that in the repository.
I have now completed Chapter 15 of the 7th edition and am proceeding to Chapter 16.
from cs11dotnet7.
Related Issues (20)
- Packt.Shared library not used for using Product type HOT 1
- Chapter 12: Creating a class library for entity models using SQLite' help needed. HOT 4
- Page 244 init-only properties HOT 1
- .Net standard is legacy but is still used? HOT 3
- Fix to the newer versions of Microsoft.Configuration.Extensions HOT 1
- Exercise 15.2 HOT 6
- No OmniSharp: Select Project HOT 5
- "Value" setting is also needed in appsettings.json, Chapter 04 switch trace levels HOT 5
- Exception when logging source code - chapter 4 HOT 1
- No instructions on how to create a unit test app HOT 5
- How GAC lead to issue if an app needs a specific version ? HOT 2
- Pattern Matching with Regular Expressions HOT 1
- Refactoring the query cause an exception HOT 4
- Addin `Model` into the Razor page cause error HOT 5
- Page 59 6th paragraph
- Page 149 HOT 2
- Exercise Solutions - Where are they? HOT 1
- Relational pattern + property pattern example missing decimal literal value suffix "M" HOT 1
- Sentence out of place in chapter 7 HOT 1
- Scaffolding
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cs11dotnet7.