Skip to content

Target framework net10.0 won't work (can't find compatible framework version) unless RuntimeFrameworkVersion is specified (1.9.0-rc3) #785

@SalvaDM

Description

@SalvaDM

Let us assume a .csproj containing the following:

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

  <PropertyGroup>
    <TargetFramework>net10.0-windows</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ExcelDna.AddIn" Version="1.9.0-rc3" />
  </ItemGroup>

</Project>

With a simple MyFunctions.cs file containing:

using ExcelDna.Integration;

namespace ExcelDNAProject1;

public static class MyFunctions
{
    [ExcelFunction(Description = "Hello .NET 10.0 world!")]
    public static string SayHello(string name)
    {
        return "Hello " + name;
    }
}

This results in a .xll file that will cause this error message to appear:

Error message: target framework could not be found

This machine does have .Net Desktop Runtime 10.0.0 (preview 7) version installed. So this is strange.

However, if RuntimeFrameworkVersion is specified in said .csproj file:

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

  <PropertyGroup>
    <TargetFramework>net10.0-windows</TargetFramework>
    <RuntimeFrameworkVersion>10.0.0-preview.7.25380.108</RuntimeFrameworkVersion>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ExcelDna.AddIn" Version="1.9.0-rc3" />
  </ItemGroup>

</Project>

This results in a working .xll file.

I should note that I've only tested this using both Debug and Release configurations, same results each time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions