0
Follows code:
public static string GetVersion()
{
return FileVersionInfo
.GetVersionInfo(Assembly.GetExecutingAssembly().Location)
.ProductVersion;
}
I get error:
- CS0103 The name "Fileversioninfo" does not exist in the current context
- CS0117 "Assembly" does not contain a definition for "Getexecutingassembly"
I am back. Netstandard with older version and get above errors.
There is another alternative to get the package version?
What version of . Net Framework? Why
FileVersionInfo
is fromSystem.Diagnostics
and theAssembly
ofSystem.Reflection
– Leandro Angelo
@Leandroangelo I’m doing with . net standard.
– Matheus Miranda
With this version of Standart it is not computable https://docs.microsoft.com/pt-br/dotnet/api/system.diagnostics.fileversioninfo?view=netframework-4.7.2. maybe you should put 1.3 which should be computable with what you are doing. ...
– novic
@Virgilionovic Need 1.2 because of . net framework 4.5.2. There is no other alternative to get the package version ?
– Matheus Miranda
Here just rolled with the
netstandard2.0
ornetcoreapp2.0
... I only have 1.0, 1.1, 2.0 and 2.1 installed– Leandro Angelo
Matheus himself is saying then that he needs this package to run as well 4.5.2 ??? if so has a way to do so and you put 4.5.2 and 1.3 in the same package!
– novic
@Virgilionovic check this link: https://docs.microsoft.com/pt-br/dotnet/standard/net-standard#net-implementation-support
– Matheus Miranda
I would make package available for 4.5.2 and 1.3 for example run the package on both netframework...
– novic
@Virgilionovic version 1.3 at least is 4.6 of the framework is not ?
– Matheus Miranda
Yes, but, because you only put it in the package, there is a way to put two or more settings that there the adpata package, example
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
this for you would solve this method would be computable– novic
You want your
netstandard
is compatible with version 4.5?– novic
@Virgilionovic actually 4.5.1 or later
– Matheus Miranda