Closed danielmarbach closed 8 years ago
So I've made SC management work but this still begs the question why do so many users have invalid license files or reg entries for the license? Something seems off here,
Time to talk to users :scream:
@danielmarbach I assume this came from a desk case. Can you ask how they added their old license?
@gbiellem They where using latest license format. We even generated a new file but it still failed. Can we offer a workaround somehow?
@Particular/servicecontrol-maintainers thoughts?
@danielmarbach
The workaround would be to import the license as covered in the docs here - http://docs.particular.net/nservicebus/licensing/license-management.
The fix to the SC management tool will ship in 1.8.4 which should go out tomorrow.
But the bug highlights a problem The fault only occurs if the tool tries to read an already installed license that does not parse correctly. So my concern is that we have fixed the tool but masked a problem with the way licenses are applied. That's why I wanted to know about how they applied the previous license.
Make that 1.9 not 1.8.4 - we've updated depedencies to address the TTBR https://github.com/Particular/ServiceControl/issues/624
Who's affected
Symptoms
When the
Details
of aDetectedLicense
instance are null theLicenseViewModel
throws aNullReferenceException
and makes it impossible to properly install the license over the license dialog.Analysis
The root cause is probably how
DetectedLicense
constructs itself. If we call the constructor ofDetectedLicense
with the path and the license text and the validations in the constructor fail then a half initializedDetectedLicense
instance is returned (whoseDetails
are null). Since the LINQ statement in theLicenseViewModel
always accesses the details in the lambda such a half initialized object throws aNullReferenceException
insidep.Details.Valid
.Stack Trace
Potential fix
DetectedLicense
should always contain the details but marked as not valid or