Why am I getting an 'install or update .NET' error when I run my .NET Engine app?

8 views (last 30 days)
I am using MATLAB .NET Engine API to build an application. I am following the directions "Build and Run .NET Projects from CLI". I am able to build my app, but when I try to run it using "dotnet run --no-build", I get the following error: "'You must install or update .NET to run this application." How can I resolve this error?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 8 Jan 2024
This error indicates that your .NET version is not compatible with the .NET version supported by your current MATLAB release. See this link for supported .NET versions:  https://www.mathworks.com/support/requirements/language-interfaces.html.
To resolve this error you need to install the required .NET SDK and the .NET Runtime from https://dotnet.microsoft.com/download.
If your application is a console application, you may be able to resolve this issue without changing .NET versions. Simply, open the .csproj file in any text editor and change the .NET version to your installed version. For example, if you have .NET 6 installed, but you are using R2022b, which requires .NET 5.0, change
<TargetFramework>net5.0</TargetFramework>
to
<TargetFramework>net6.0</TargetFramework>
Note that this simple workaround is not guaranteed to work, and, if it does not work, you will need to install the .NET SDK and the .NET Runtime.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!