Jonathan Allen
Jonathan Allen

Reputation: 70287

How do I read a DLLs version number in MSBuild?

How do I read a DLLs version number in MSBuild and place it into a variable for use later?

Upvotes: 0

Views: 94

Answers (1)

Kevin Richardson
Kevin Richardson

Reputation: 3622

See the GetAssemblyIdentity task.

    <GetAssemblyIdentity AssemblyFiles="MyDll.dll">
        <Output TaskParameter="Assemblies" ItemName="myAssemblyInfo"/>
    </GetAssemblyIdentity>

%(myAssemblyInfo.Version) will provide the DLL version.

Upvotes: 3

Related Questions