Windows forms application targetting .net framework 4.8 is working fine in machine where only .net framework 4.7.2 is installed.

JYOTHISH MB 5 Reputation points
2025-09-16T13:12:47.0633333+00:00

I have an exe which is written using .NET Framework 4.8. I have the following line in the vbproj file of the exe.

<ItemGroup>
    <BootstrapperPackage Include=".NETFramework,Version=v4.8">
      <Visible>False</Visible>
      <ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
      <Install>true</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.5 SP1</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
  </ItemGroup>I

I have noticed a behavior. When I open the exe from start button, it's working fine in a machine where .NET Framework 4.8 is not installed. But it's throwing the error "this application requires one of the following versions of .NET framework. .NET framework version=v4.8" when I double click on the exe from the installed location. Why this difference in behavior?

Developer technologies | .NET | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Surya Amrutha Vaishnavi Lanka (INFOSYS LIMITED) 810 Reputation points Microsoft External Staff
    2025-09-17T11:36:57.5533333+00:00

    Thanks for sharing the details, here are some steps which are helpful

    1. Install .NET Framework 4.8 on the target machine, since your app is built against 4.8, you should ensure 4.8 is installed.
    2. Retarget your application to 4.7.2 in Visual Studio. If you need compatibility with machines that only have 4.7.2, retarget your project in Project Properties.

    3.Ensure your setup project (.vbproj snippet you shared) correctly includes the .NET Framework 4.8 redistributable so it prompts to install if missing.

    If you control deployment, always bundle or require .NET 4.8 since it’s backward-compatible with 4.7.2 apps.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.