eXpandFramework / eXpand

DevExpress XAF (eXpressApp) extension framework. 𝗹𝗶𝗻𝗸𝗲𝗱𝗶𝗻.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺, 𝘆𝗼𝘂𝘁𝘂𝗯𝗲.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺 and 𝘁𝘄𝗶𝘁𝘁𝗲𝗿 @𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 and or simply 𝗦𝘁𝗮𝗿/𝘄𝗮𝘁𝗰𝗵 this repository and get notified from 𝗚𝗶𝘁𝗛𝘂𝗯
http://expand.expandframework.com
Microsoft Public License
220 stars 114 forks source link

Net SDK could not be found #1064

Open CWolffIF opened 1 month ago

CWolffIF commented 1 month ago

Hi,

I get the error with the ModelEditor: image

eXpressAppFramework.log

In the Project the first lines are `

` The Path of the dotnet and the installation seems to be OK. where.exe and dotnet --info PS C:\Users\CWolff> where.exe dotnet C:\Program Files\dotnet\dotnet.exe PS C:\Users\CWolff> dotnet --info .NET SDK: Version: 8.0.303 Commit: 29ab8e3268 Workload version: 8.0.300-manifests.34944930 MSBuild version: 17.10.4+10fbfbf2e Laufzeitumgebung: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.303\ Installierte .NET-Workloads: [aspire] Installationsquelle: VS 17.10.35122.118 Manifestversion: 8.0.0/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.0\WorkloadManifest.json Installationstyp: FileBased [maui-windows] Installationsquelle: VS 17.10.35122.118 Manifestversion: 8.0.61/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.61\WorkloadManifest.json Installationstyp: FileBased [maccatalyst] Installationsquelle: VS 17.10.35122.118 Manifestversion: 17.2.8053/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.2.8053\WorkloadManifest.json Installationstyp: FileBased [ios] Installationsquelle: VS 17.10.35122.118 Manifestversion: 17.2.8053/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8053\WorkloadManifest.json Installationstyp: FileBased [android] Installationsquelle: VS 17.10.35122.118 Manifestversion: 34.0.95/8.0.100 Manifestpfad: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.95\WorkloadManifest.json Installationstyp: FileBased Host: Version: 8.0.7 Architecture: x64 Commit: 2aade6beb0 .NET SDKs installed: 8.0.303 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.7 [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
apobekiaris commented 1 month ago

The ME works only for the debug release so make sure u have build the project first in debug. Additionally try to delete all ME files from the roaming path.

Let me know if my suggestions did not work

CWolffIF commented 1 month ago

Hi,

I deleted everything, but the same error.

apobekiaris commented 1 month ago

do u recall anything that change in your enviroment since your last successfull run?

CWolffIF commented 1 month ago

Yes, I deinstalled VS2019. After that I made a repair VS2022.

CWolffIF commented 1 month ago

I try to Deinstal Net.SDK from VS2022 and than reinstall. May it helps......

apobekiaris commented 1 month ago

have u restarted?

CWolffIF commented 1 month ago

Yes. I´ve reinstalled everthing and restarted, emptied the ME Pathes and started in Debug. Same error.

I wonder about MSBuildExtensions.cs:line 25

eXpressAppFramework.log

Type: InvalidProjectFileException Message: The SDK 'Microsoft.NET.Sdk' specified could not be found. C:\DevProjects\iXISnetJH\iXISXRM.Module\iXISXRM.Module.csproj Data: 0 entries Stack trace:

at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)

at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError) at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult) at Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) at Microsoft.Build.Evaluation.Evaluator4.Evaluate() at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, EvaluationContext evaluationContext) at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext) at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion) at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, String toolsVersion) at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName) at Xpand.XAF.ModelEditor.Module.Win.MSBuildExtensions.<>c__DisplayClass1_0.b__1(ProjectInSolution projectInSolution) in C:\Work\Reactive.XAF\tools\Xpand.XAF.ModelEditor\IDE\ModelEditor.Win\Xpand.XAF.ModelEditor.Module.Win\MSBuildExtensions.cs:line 25

apobekiaris commented 1 month ago

I cannot follow that is a native call with the Microsoft.Build.Evaluation lib and it worked b4 your sdk reinstallation. In addition also it works on my side and nobody else reported issues. Do you have specific concerns? My impression is that your system config is suffering.

Did you also tried it in a different machine? the msg is clear the SDK is not found meaning paths problem e.g.

https://learn.microsoft.com/en-us/answers/questions/1184941/the-sdk-microsoft-net-sdk-specified-could-not-be-f

CWolffIF commented 1 month ago

I tried everything from that link. But everything seems to be OK. The SDK is found and the SDK check says

PS C:\devprojects\ixisnetjh> dotnet --list-sdks 8.0.303 [C:\Program Files\dotnet\sdk]

PS C:\devprojects\ixisnetjh> dotnet sdk check .NET SDKs: Version Status

8.0.303 Auf dem neuesten Stand.

Testen Sie die neuesten .NET SDK-Features mit .NET 9.0.100-preview.6.24328.19.

.NET-Runtimes: Name Version Status

Microsoft.NETCore.App 6.0.12 Die Unterstützung von .NET 6.0 läuft in Kürze aus. Microsoft.AspNetCore.App 6.0.32 Die Unterstützung von .NET 6.0 läuft in Kürze aus. Microsoft.NETCore.App 6.0.32 Die Unterstützung von .NET 6.0 läuft in Kürze aus. Microsoft.WindowsDesktop.App 6.0.32 Die Unterstützung von .NET 6.0 läuft in Kürze aus. Microsoft.AspNetCore.App 7.0.20 .NET 7.0 wird nicht mehr unterstützt. Microsoft.NETCore.App 7.0.20 .NET 7.0 wird nicht mehr unterstützt. Microsoft.WindowsDesktop.App 7.0.20 .NET 7.0 wird nicht mehr unterstützt. Microsoft.AspNetCore.App 8.0.7 Auf dem neuesten Stand. Microsoft.NETCore.App 8.0.7 Auf dem neuesten Stand. Microsoft.WindowsDesktop.App 8.0.7 Auf dem neuesten Stand.

apobekiaris commented 1 month ago

I understand your frustration but really looks enviromental in your side nothing I can do.

Did you also tried it in a different machine

if it works at least will know to blame your enviroment else we discuss it further

CWolffIF commented 1 month ago

Hi, I´ve got the solution. I had only the SDK for .net 8. The ME needs the SDK for .net 6. I installed SDK .net 6 and it works.

apobekiaris commented 1 month ago

great!

note: ME works as well for other sdk, meaning your project apparently target .net6, but when u upgrade .net ME will download different libs in different dirs in your roaming folder. This is info only no action should required from your side

apobekiaris commented 1 month ago

let me clarify this a bit further, so ME does not require .net6 if your project tagrets .net8, a different version will be downloaded transparent to u looking at the targetframework of each project

CWolffIF commented 1 month ago

Mhmm, thats crazy. Cause the whole project is set to .net8

image

apobekiaris commented 1 month ago

what is the location of the ME process? after u run it. Get it from right click the process Open File Location on the task manager

CWolffIF commented 1 month ago

The Background Process Xpand.XAF.ModelEditor.Win is running in C:\Users\CWolff\AppData\Roaming\Xpand.XAF.ModelEditor.Win\Xpand.XAF.ModelEditor.Win

If you open the Modeleditor Xpand.XAF.ModelEditor C:\Users\CWolff\AppData\Roaming\Xpand.XAF.ModelEditor.Win\WinDesktop\net8.0-windows10.0.22621.0\4.241.1.0

Here is a Screenshot of the System (Roaming): image

The Xpand\Xpand.XAF.ModelEditor.Win\4.21.1.0: is empty The Xpand.XAF.ModelEditor.Win\Xpand.XAF.ModelEditor.Win: the Background Task is working The Xpand.XAF.ModelEditor.Win\WinDesktop: the ME is in foreground working

I think my error was, that the Backgroundtask could not create the Foregroundtask. With .net6 SDK it is possible and it is created as .net8 Version (\net8.0-windows10.0.22621.0\4.241.1.0) like my Project.

apobekiaris commented 1 month ago

thnks I will research this case when I have time for now everything is functional and this a design time feature so is not urgent. In any case please leave the ticket open