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

조회 수: 30 (최근 30일)
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 0.0.0.0.
Any options available to provide version information to the dotnetbuilder output?

채택된 답변

awa
awa 2018년 11월 28일
편집: awa 2018년 11월 28일
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.
DeploytoolSettings.png
  댓글 수: 6
Jose Maria Lorenzo
Jose Maria Lorenzo 2023년 2월 10일
Facing the same issue, any update on this?? Properly working for standard dll but for .NET native file it does not work ( working on 2016B ).
Sophia
Sophia 2024년 3월 19일 17:32
The following article provides details on the workflow to add the version information:
https://www.mathworks.com/matlabcentral/answers/2096376-is-it-possible-to-set-the-assembly-version-of-a-dll-created-with-matlab-compiler-sdk-or-matlab-buil
The workflow described for MATLAB R2019b and up should work for R2016b as well. Please note that the second command described in step 3 is responsible for adding the version information to the .NET native file.

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Richa Gupta
Richa Gupta 2015년 7월 20일
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?
-Richa
  댓글 수: 3
Morris Maynard
Morris Maynard 2018년 5월 11일
편집: Morris Maynard 2018년 5월 11일
The answer does not work. If I "view and change version number under the Application Information section" (by the way, the linked page does not mention this or show it as a possibility) it does not change the version number of the .Net dll. The .Net assembly version is very important and is always in the format w.x.y.z, where wxy and z are numbers. Whatever the version number specified in the Settings menu it, it won't allow input in this format.
Girija Jarvis
Girija Jarvis 2018년 11월 27일
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

댓글을 달려면 로그인하십시오.


Ralph Coleman
Ralph Coleman 2020년 1월 31일
편집: Ralph Coleman 2020년 1월 31일
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:

Sophia
Sophia 2024년 3월 19일 17:27
The following article discusses how to specify the version number for .NET .DLLs. Please see this link for more information:
https://www.mathworks.com/matlabcentral/answers/2096376-is-it-possible-to-set-the-assembly-version-of-a-dll-created-with-matlab-compiler-sdk-or-matlab-buil

카테고리

Help CenterFile Exchange에서 Deploy to .NET Applications Using MWArray API에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by