C# Interfaces with optional methods

You should create two interfaces: interface ITest { void MethodOne(); } interface ITest2 : ITest { void MethodTwo(); } This would also make it clear which functionality requires which version of your interfaces, so that you don’t have to check whether the class implementing the interface is implementing just one, or both, methods.

create version.txt file in project dir via build.gradle task

The example you’re referring to is almost correct. With a couple of minor tweaks it works as expected: import java.text.SimpleDateFormat import org.ajoberstar.grgit.Grgit plugins { id “org.ajoberstar.grgit” version “1.7.2” } version = 1.0 task versionTxt() { doLast { new File(projectDir, “version.txt”).text = “”” Version: $version Revision: ${grgit.head().abbreviatedId} Buildtime: ${new SimpleDateFormat(“dd-MM-yyyy HH:mm:ss”).format(new Date())} Application-name: foobarbaz app “”” … Read more

Specify assembly version number as a command line argument in MSBuild

For SDK-style projects that are built using dotnet.exe, assembly version attributes are generated automatically, so you can use /p:Version=5.4.3.0 right out of the box. If you use the old project format, you need to add the following BeforeBuild step to your .csproj file. No need to use extra .targets and extension packs, because MSBuild already … Read more

Versioning Database Persisted Objects, How would you? [closed]

Think carefully about the requirements for revisions. Once your code-base has pervasive history tracking built into the operational system it will get very complex. Insurance underwriting systems are particularly bad for this, with schemas often running in excess of 1000 tables. Queries also tend to be quite complex and this can lead to performance issues. … Read more

How to get exe application name and version in C# Compact Framework

Getting the app name: System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; Getting the version: System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; You might want to use GetCallingAssembly() or getting the assembly by type (e.g. typeof(Program).Assembly) if your DLL is trying to get the EXE version and you don’t have immediate access to it. EDIT If you have a DLL and you need the name of the executable … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)