horsdal / microservices-in-dotnetcore Goto Github PK
View Code? Open in Web Editor NEWThe code sample from my microservices book - https://manning.com/books/microservices-in-net-core
License: MIT License
The code sample from my microservices book - https://manning.com/books/microservices-in-net-core
License: MIT License
This could entirely be our fault, but when trying to use the reusable platform in Chapter 11 we are encountering an error, any help appreciated. We are using VS2017 RC2 and net core 1.1.
11:41:17 [Error] () Unhandled exception
System.NullReferenceException: Object reference not set to an instance of an object.
at MicroserviceNET.Auth.Authorization.<>c__DisplayClass0_0.b__0(IDictionary2 env) at MicroserviceNET.Logging.MonitoringMiddleware.Invoke(IDictionary
2 env)
at MicroserviceNET.Logging.PerformanceLogging.<>c__DisplayClass0_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MicroserviceNET.Logging.RequestLogging.<>c__DisplayClass0_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MicroserviceNET.Logging.CorrelationToken.<>c__DisplayClass0_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MicroserviceNET.Logging.GlobalErrorLogging.<>c__DisplayClass0_0.<b__0>d.MoveNext()
In page 239, I see you write:
"
Because you want to put
the token in every request you’ll make to the Loyalty Program microservice, you’ll
request the token in the HttpClientFactory you created in chapter 8
"
I think it should be "chapter 9" instead "chapter 8"
:)
Any luck on updating Chap04 to the new csproj for use with the dotnet-cli? (on the 2017-05 branch) There are also other projects that have not been updated. I suspect that the conversion has issues.
The Chap04 code has not been updated for the new .csproj, and did try upgrade using "dotnet migrate" but encountered lots of issues, so I gave up trying to figure out how to get "dotnet build" work with "net461" as the targetframework.
I was hoping that some brave soul would know how to get this to work for the dotnet-cli. I have not tried using Vs2015 or VS2017 to build this project.
Thanks
Hi, I started reading your book at manning, I downloaded the code and tried opening the shopping cart project in VS2019, it is not recognized, can you help please and let me know how can this be opened? Thanks
I read your book and try to reproduce your code.
Unfortunately, there are a lot of inaccuracies and mistakes in it so it will not run as it is.
My question about chapter 5.
When you use Event Store db as storage you deserialize Content obj like this:
Content = JsonConvert.DeserializeObject(
Encoding.UTF8.GetString(ev.Event.Data))
But when I do so and use Postman to check result I get this:
{
"sequenceNumber": 0,
"occuredAt": "2018-03-17T22:30:08.2609772+03:00",
"name": "ShoppingCartItemAdded",
"content": [
[
[]
],
[
[
[
[]
],
[
[]
],
[
[]
],
[
[]
]
]
]
]
}
There is empty json object.
I tried this solution and it works:
var myObject = new { UserId = 0, item = new ShoppingCartItem() };
...
Content = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(ev.Event.Data), myObject .GetType())
But it's terrible solution because EventStore class needs to know about ShoppingCartItem but it should not.
Please, tell me how to correctly deserialize object. Or is it Nancy specific?
Can you please let me know which version of Nancy I need to install. When I install the latest I get the error Package Nancy 1.4.3 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Nancy 1.4.3 supports: net40 (.NETFramework,Version=v4.0).
I've gotten to the end of the book and was going to try running the chapter 12 project which references the project in chapter 11 for the OWIN middleware. When opening the chapter 12 project and modifying file locations to fit the local location for chapter 11 MicroserviceNET.Platform.csproj I receive the error
Unable to resolve 'C:\Users\trevor.jacobson\Documents\Visual Studio 2017\Projects\microservices-in-dotnetcore\src\Chapter11\MicroserviceNET.Platform\MicroserviceNET.Platform.csproj' for '.NETCoreApp,Version=v1.1'.
I believe its saying that the platform project files aren't compatible with .NetCoreApp V1.1. I'm not sure what other modifications have to be made to either project but any insight into this issue would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.