How can file version and product version be defined, when compiling a matlab code to a dll with dotnetbuilder?

74 views (last 30 days)
awa on 15 Jul 2015
Edited: Ralph Coleman on 31 Jan 2020
The project in deploytool does not take parameters for the produced dll-properties file version, product version. Generated dlls always have a file version of
Any options available to provide version information to the dotnetbuilder output?

Accepted Answer

awa on 28 Nov 2018
Edited: awa on 28 Nov 2018
The way we build dotnet dlls with version info nowadays, is to not use the project files but the mcc compiler on the command line / script and include an Assemblyinfo.cs -file as C# -code created by the build script including the version information. The full filename of AssemblyInfo.cs is added to the mcc command line.
This is also working if you add an appropriate AssemblyInfo.cs as an additional parameter passed to MCC. Just tried on an older project.

Sign in to comment.

More Answers (2)

Richa Gupta
Richa Gupta on 20 Jul 2015
Hi Awa,
It is possible to provide version of the .NET DLL generated using MATLAB Compiler. You can do this using the "Library version" field in deploytool. For more information, you can refer to the following link:
As you can see, you can view and change the version number under the Application Information section.
Also, what do you mean by specifying the product version for a DLL?
Girija Jarvis
Girija Jarvis on 27 Nov 2018
If you have by now learnt how to version the .net assembly version please can you share the details with me, i am unable to version the .net dll either

Sign in to comment.

Ralph Coleman
Ralph Coleman on 31 Jan 2020
Edited: Ralph Coleman on 31 Jan 2020
From MATLAB R2019b, the solution using an "AssemblyInfo.cs" file containing the AssemblyVersion attribute causes a compilation error.
Instead, now enter directly the library version in the suitable field of the Library Compiler tool as shown below.
Note that 4 digit versions are now accepted (whereas only two digits were accepted in previous versions).
However, the other attributes in "AssemblyInfo.cs" can still be used as in the example code below:
using System.Reflection;
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyProduct("DemoToolCore")]
[assembly: AssemblyInformationalVersion("2.5alpha")]
Note the absence of AssemblyVersion and AssemblyFileVersion attributes - the latter does not cause a compilation error but overwrites the library version given in the field above, so it is to be avoided.
The result obtained is the following:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by