question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable Platform-Specific Resourcing (ditch the #defs)

See original GitHub issue

Now that VS2017 is out (#92), it might be worth exploring a more structured/discoverable way to introduce and locate platform-specific resources and dependencies.

One thought is to use convention by default, and do a test for an assembly that has the same name as the current assembly + Platforms + moniker. So, in the case of ExtendedXmlSerializer:

  • ExtendedXmlSerializer.Platforms.NetCore <== .NET Core
  • ExtendedXmlSerializer.Platforms.NetFramework <== .NET Framework

Additionally, once the assembly has been resolved and located, a simple call to register it with the current (internal) container (enabling the use of an ICompositionRoot) would be a very straight forward task.

Advantages of this approach:

  • No more #defines (!)
  • Clean separation of platform concerns

Disadvantages:

  • Two more assemblies to account for in our solution and for NuGet.
  • ? (Additional feedback welcomed)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
WojciechNagorskicommented, Jun 27, 2017

Ok it sounds good.

1reaction
Mike-E-angelocommented, Jun 27, 2017

OK. 😃 I think the way to go for now is to do one project to multiple frameworks, like v1.0, and then for v3.0 we can revisit this, maybe for #107.

Since there is only one #if this isn’t a big deal for 2.0, but I think for .NET Standard 1.x it will require many more #if’s, and that will be ugly, so having separate projects will be better then.

Sound good?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage resource lifecycle | Terraform
Lifecycle arguments help control the flow of your Terraform operations by creating custom rules for resource creation and destruction.
Read more >
Manage Consul with Kubernetes custom resource ...
Learn how to work with config entries as Custom Resource Definitions (CRDs); Download the latest helm chart; Install or upgrade Consul (with Helm...
Read more >
Revised Definition of “Waters of the United States”
Waters considered “jurisdictional by rule” included: (1) traditional navigable waters; (2) interstate waters, including interstate wetlands; (3) ...
Read more >
RCW 49.46.300: Transportation network companies ...
(j) "Driver platform" means the driver-facing application dispatch system software or any online-enabled application service, website, or system, used by a ...
Read more >
What is Zero Trust?
Zero Trust refers to a security approach that assumes no user is trustworthy. Adopting this concept with zero trust vendors protects against cyber...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found