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

Executing a bundle gives framework error. #35511

Open
dajma00 opened this issue Jan 22, 2025 · 1 comment
Open

Executing a bundle gives framework error. #35511

dajma00 opened this issue Jan 22, 2025 · 1 comment

Comments

@dajma00
Copy link

dajma00 commented Jan 22, 2025

Question

For my dotnet application I created an efcore bundle with the following command so I can run migration when I deploy the application to a PC:
dotnet ef migrations bundle --context applicationdbcontext -o c:\users\hp\downloads\bundle1.exe --force
But when I run the bundle on the target machine, I get the following error:

You must install or update .NET to run this application.

App: C:\Users\Amjad\Downloads\AppName\bundle1.exe
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '9.0.0' (x64)
.NET location: C:\Users\Amjad\Downloads\AppName\

No frameworks were found.

Output of dotnet --info is a follows:

C:\Users\hp>dotnet --info
.NET SDK:
 Version:           9.0.102
 Commit:            cb83cd4923
 Workload version:  9.0.100-manifests.43af17c7
 MSBuild version:   17.12.18+ed8c6aec5

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.102\

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.1
  Architecture: x64
  Commit:       c8acea2262

.NET SDKs installed:
  8.0.204 [C:\Program Files\dotnet\sdk]
  9.0.102 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  [https://aka.ms/dotnet/download](https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fdotnet%2Fdownload&data=05%7C02%7C%7C4f5c15d5d67f4638177208dd3af4334e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638731542700283098%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=h3D2xh%2BXcXnHmSZG1UojfzmslbUAVOJNVMRek7dM960%3D&reserved=0)```
So the question is that why does bundle1.exe not execute and asking for framework to be installed when I have all frameworks installed (9.0.0)?

### Your code

```csharp

Stack traces


Verbose output


EF Core version

9.0.0

Database provider

No response

Target framework

No response

Operating system

No response

IDE

No response

So the question is why wouldn't the bundle1.exe file execute when .NET9 SDK is installed?

@AndriySvyryd
Copy link
Member

Do you also have the 9.0.102 SDK on the machine that compiled the bundle?

@AndriySvyryd AndriySvyryd self-assigned this Jan 25, 2025
@AndriySvyryd AndriySvyryd added this to the 10.0.0 milestone Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants