.net - TargetFramework FrameworkDisplayName empty -
what effective difference between following assembly attributes - is, runtime difference, if any, might occur.
[assembly: targetframework(".netframework,version=v4.5.2", frameworkdisplayname = "")] [assembly: targetframework(".netframework,version=v4.5.2", frameworkdisplayname = ".net framework 4.5.2")]
the 1st produced msbuild (with warnings) when build machine not have 4.5.2 reference assemblies (via targeting pack) installed. 2nd produced when build machine has reference assemblies installed (the warnings disappear). feel 2nd somehow more correct, don't have concrete facts support this. both binaries appear work.
targetframework
identifies version of .net framework particular assembly compiled against.
the targetframeworkattribute attribute can specify frameworkdisplayname property provide more descriptive .net framework version string suitable displaying clients of assembly
frameworkdisplayname
gets display name of .net framework version against assembly built.
the example below emphasis correctness of 2nd line mentioned:
the following example applies targetframeworkattribute assembly , assigns both property values indicate assembly built using .net framework 4.5.2.
using system; using system.runtime.versioning; [assembly:targetframework(".netframework,version=v4.5.2", frameworkdisplayname = ".net framework, version 4.5.2")] namespace mycompany.utilities { public class stringlibrary { // members defined here. } }
i hope clears question.
Comments
Post a Comment