-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add version types to AssemblyVersion layout renderer #2480
Comments
Sounds good to me! Please make sure it's backwards-compatible and that the enum is in-line with the other enums (naming etc) Thx in advance! |
I've started working on this and can see the need to test against different frameworks due to conditional compilation. How do I switch to run unit tests in, say, Silverlight vs .NET Core 2.0 vs .NET Framework 4.5? Also, I need one or more "test assemblies" with different version numbers set for each version type so I can correctly write unit tests for this. At the moment the Thanks for your help! |
Hi! The tests will be run for all the platforms automatically. Maybe it's better to make the layout renderer mockable (internal property, guess type Assembly) and create a mock? |
I could create a mock, but how will I know it's actually working correctly for each platform? Perhaps I will make a little test project/repo in my GitHub account and report back here? |
The unit test is run for the platforms? Or are you afraid for Xamarin etc? |
Yes I'm thinking of Xamarin, Mono, UWP, etc... Working on this feature highlighted to me how fractured the ecosystem is despite the introduction of .NET Standard! So I would like to have some more confidence in those other platforms. Unless it is better to assume it will all work and tackle exceptions on a case-by-case basis. Any problems are more likely to be found on older platforms and it's possible they may never use this feature? What I have been able to do is adapt code from other unit tests to build an in-memory assembly for testing using Roslyn. That works great 😃 |
@alexangas If you can make it work with NetFramework and NetStandard on Windows, then you are very close to done. If you can also make it work on Mono and NetStandard on Linux, then you are home safe. Other platforms only rely on it being able to compile on the build-server. Usually the test-project "NLogAutoLoadExtension" or "SampleExtensions" are used for doing external assembly testing. |
merged 👍 |
Type: Feature request
NLog version: 4.5.0
Platform: .Net 3.5 / .Net 4.0 / .Net 4.5 / Mono 4 / Silverlight 4 / Silverlight 5 / Xamarin Android / Xamarin iOs / .NET Core
Current NLog config: N/A
I would like to extend the AssemblyVersion layout renderer to be able to specify different version types, e.g. from here:
So the current renderer syntax of
${assembly-version:name=string}
could become${assembly-version:name=string:type=string}
where the value fortype
is one of:I'm happy to provide this in a pull request with unit tests, etc... if agreed 😃
The text was updated successfully, but these errors were encountered: