Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow exact runtime patch version to be targeted #722

Closed
govert opened this issue Sep 25, 2024 · 0 comments · Fixed by #725
Closed

Allow exact runtime patch version to be targeted #722

govert opened this issue Sep 25, 2024 · 0 comments · Fixed by #725
Assignees
Milestone

Comments

@govert
Copy link
Member

govert commented Sep 25, 2024

This project file

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0-windows</TargetFramework>
    <RuntimeFrameworkVersion>8.0.6</RuntimeFrameworkVersion>
    <RollForward>Disable</RollForward>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ExcelDna.AddIn" Version="1.8.0" />
  </ItemGroup>  
</Project>

creates a .runtimeconfig.json file like this:

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "rollForward": "Disable",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "8.0.6"
    },
    "configProperties": {
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}

which I expect should work with this runtime installation

PS C:\Users\GovertvanDrimmelen> dotnet --list-runtimes
[...]
Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

However, when loading the add-in we get this error:

---------------------------
TestExactVersion Add-In - ExcelDna.Host
---------------------------
It was not possible to find a compatible framework version for .NET Desktop Runtime 8.0.0 x64.

You can download .NET Desktop Runtime 8.0.0 x64 from https://dotnet.microsoft.com/en-us/download/dotnet/
---------------------------
OK   
---------------------------

This is because the generated .dna file does not include the patch version

<DnaLibrary RollForward="Disable" Name="TestExactVersion Add-In" RuntimeVersion="v8.0" xmlns="http://schemas.excel-dna.net/addin/2020/07/dnalibrary">

We should extend the version support in the .dna file to include the minor and patch components too.
Taht would allow a user to fix a particular runtime patch version to target.

@govert govert added this to the 1.9 milestone Sep 25, 2024
@govert govert changed the title Check whether exact runtime version can be fixed Allow exact runtime patch version to be targeted Sep 25, 2024
@Sergey-Vlasov Sergey-Vlasov linked a pull request Oct 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants