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

Stride's Visual Studio Extension does not work in VS2022(17.8.2) #2072

Closed
itn3000 opened this issue Nov 30, 2023 · 11 comments
Closed

Stride's Visual Studio Extension does not work in VS2022(17.8.2) #2072

itn3000 opened this issue Nov 30, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@itn3000
Copy link

itn3000 commented Nov 30, 2023

Release Type: Official Release

Version: 4.2.0.2043

Platform(s):

  • Windows 11 x64
  • Visual Studio 2022 Community Edition(17.8.2)
  • dotnet sdk: 8.0.100

Describe the bug
error message was displayed in output window in visual studio 2022 and shader helper did not work.

To Reproduce
Steps to reproduce the behavior:

  1. install Visual Studio 2022(17.8.2)
  2. Install Visual Studio extension for Stride from Stride launcher
  3. open Stride project
  4. open VS from Stride editor
  5. add custom shader file to project by VS

Expected behavior
there is no error message and cs file is generated when sdsl file is added to project.

Screenshots
If applicable, add screenshots to help explain your problem (use GitHub drag & drop)

Log and callstacks

Error initializing Stride command proxy: System.InvalidOperationException: Could not restore Stride.VisualStudio.Commands 4.2.0.2043, this visual studio extension may fail to work properly without it. To fix this you can either build Stride.VisualStudio.Commands or pull the right version from nugget manually
   場所 Stride.VisualStudio.Commands.StrideCommandsProxy.<FindStrideSdkDir>d__16.MoveNext()
--- 直前に例外がスローされた場所からのスタック トレースの終わり ---
   場所 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   場所 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   場所 Stride.VisualStudio.StridePackage.<InitializeCommandProxy>d__19.MoveNext()

Additional context
Add any other context about the problem here.

@itn3000 itn3000 added the bug Something isn't working label Nov 30, 2023
@Nicogo1705
Copy link
Contributor

#2064

someone is already working on it :)

@NicusorN5
Copy link
Contributor

Hi, as far as I know, this is fixed. Should this issue be marked as solved?

@Eideren
Copy link
Collaborator

Eideren commented Jan 20, 2024

Thanks for the reminder @NicusorN5

@Eideren Eideren closed this as completed Jan 20, 2024
@Sunflair0
Copy link

Sunflair0 commented Jun 11, 2024

This is the error message I get when trying to start Stride 3.0.0.9. I have VS 2022 with all the C# and game extensions I can think of:

The window is labeled Xenko Game Studio 3.0.0.9

Could not find a compatible version of MSBuild.
Check that you have a valid installation with the required workloads, or go to www.visualstudio.com/downloads to install a new one.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.MemoryExtensions.AsSpan(String text) at Microsoft.Build.Evaluation.Expander2.Function1.ExtractPropertyFunction(String expressionFunction, IElementLocation elementLocation, Object propertyValue, UsedUninitializedProperties usedUnInitializedProperties, IFileSystem fileSystem) at Microsoft.Build.Evaluation.Expander2.PropertyExpander1.ExpandPropertyBody(String propertyBody, Object propertyValue, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem)
at Microsoft.Build.Evaluation.Expander2.PropertyExpander1.ExpandPropertiesLeaveTypedAndEscaped(String expression, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem) at Microsoft.Build.Evaluation.Expander2.PropertyExpander1.ExpandPropertiesLeaveEscaped(String expression, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem)
at Microsoft.Build.Evaluation.Expander2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation) at Microsoft.Build.Evaluation.ToolsetReader.ExpandPropertyUnescaped(ToolsetPropertyDefinition property, Expander2 expander)
at Microsoft.Build.Evaluation.ToolsetReader.EvaluateAndSetProperty(ToolsetPropertyDefinition property, PropertyDictionary1 properties, PropertyDictionary1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties, String& toolsPath, String& binPath, Expander2& expander)
at Microsoft.Build.Evaluation.ToolsetReader.ReadToolset(ToolsetPropertyDefinition toolsVersion, PropertyDictionary1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties)
at Microsoft.Build.Evaluation.ToolsetReader.ReadEachToolset(Dictionary2 toolsets, PropertyDictionary1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties) at Microsoft.Build.Evaluation.ToolsetReader.ReadToolsets(Dictionary2 toolsets, PropertyDictionary1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties, String& msBuildOverrideTasksPath, String& defaultOverrideToolsVersion)
at Microsoft.Build.Evaluation.ToolsetReader.ReadAllToolsets(Dictionary2 toolsets, ToolsetRegistryReader registryReader, ToolsetConfigurationReader configurationReader, PropertyDictionary1 environmentProperties, PropertyDictionary1 globalProperties, ToolsetDefinitionLocations locations) at Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetRegistryReader registryReader, ToolsetConfigurationReader configReader) at Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary2 globalProperties, IEnumerable1 loggers, IEnumerable`1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly) at Xenko.Core.Assets.PackageSessionPublicHelper.CheckMSBuildToolset() at Xenko.GameStudio.Program.d__12.MoveNext() in C:\dev\xenko2\sources\editor\Xenko.GameStudio\Program.cs:line 242
WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

@Kryptos-FR
Copy link
Member

Xenko is unsupported, it was made when SiliconStudio was still developing the game engine. Stride is the FOSS version. Xenko versions are only provided for compatibility reason in case someone had an old project they wanted to migrate. It shouldn't be used for new projects.

@Sunflair0
Copy link

That's what I thought I read. But, every download puts it on my computer. I have installed, uninstalled it maybe 6 times at this point. What is the link where I can get a good download, or is it just the one site?

@Eideren
Copy link
Collaborator

Eideren commented Jun 13, 2024

What you've stumbled into is actually a weird issue with nuget which is the provider for the download. Open your cmd/terminal and run:

dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org

And you should be good to go

@Sunflair0
Copy link

That got me further, but I get this:

Could not find a compatible version of MSBuild.
Check that you have a valid installation with the required workloads, or go to www.visualstudio.com/downloads to install a new one. Also make sure you have the latest .NET 6 SDK
System.BadImageFormatException: Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Format of the executable (.exe) or library (.dll) is invalid. File name: 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.BadImageFormatException: Could not load file or assembly 'C:\Program Files (x86)\dotnet\sdk\8.0.301\Microsoft.Build.dll'. Format of the executable (.exe) or library (.dll) is invalid. File name: 'C:\Program Files (x86)\dotnet\sdk\8.0.301\Microsoft.Build.dll' at System.Runtime.Loader.AssemblyLoadContext.g_PInvoke|50(IntPtr _ptrNativeAssemblyBindernative, UInt16* _ilPathnative, UInt16* _niPathnative, ObjectHandleOnStack _retAssemblynative) at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath) at Stride.Core.Assets.PackageSessionPublicHelper.<>cDisplayClass31.b_1(AssemblyLoadContext assemblyLoadContext, AssemblyName assemblyName) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSessionPublicHelper.cs:line 67 at System.Runtime.Loader.AssemblyLoadContext.GetFirstResolvedAssemblyFromResolvingEvent(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) at Stride.Core.Assets.PackageSessionPublicHelper.SetupMSBuildCurrentHostForOutOfProc(String dotNetSdkPath) at Stride.Core.Assets.PackageSessionPublicHelper.FindAndSetMSBuildVersion() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSessionPublicHelper.cs:line 75 at Stride.GameStudio.Program.Startup(UFile initialSessionPath) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\editor\Stride.GameStudio\Program.cs:line 221

@Sunflair0
Copy link

Sunflair0 commented Jun 13, 2024

I have .net 8 with VS. And I installed 4.2.0.2149. I am using Powershell to install, and it did work. I did the trust command for the cert.

Is it finicky as to where it is installed? What directory?
I am positive I did the MSBuild.

@Sunflair0
Copy link

I am still having problems with this. Is this the correct place to post for it?

I have gone into the file MSBuild and seen the files it says it cannot find.

Here is the error message:

Could not find a compatible version of MSBuild.
Check that you have a valid installation with the required workloads, or go to www.visualstudio.com/downloads to install a new one. Also make sure you have the latest .NET 6 SDK
System.BadImageFormatException: Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Format of the executable (.exe) or library (.dll) is invalid. File name: 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.BadImageFormatException: Could not load file or assembly 'C:\Program Files (x86)\dotnet\sdk\8.0.301\Microsoft.Build.dll'. Format of the executable (.exe) or library (.dll) is invalid. File name: 'C:\Program Files (x86)\dotnet\sdk\8.0.301\Microsoft.Build.dll' at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath) at Stride.Core.Assets.PackageSessionPublicHelper.<>cDisplayClass3_1.b1(AssemblyLoadContext assemblyLoadContext, AssemblyName assemblyName) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSessionPublicHelper.cs:line 67 at System.Runtime.Loader.AssemblyLoadContext.GetFirstResolvedAssemblyFromResolvingEvent(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) at Stride.Core.Assets.PackageSessionPublicHelper.SetupMSBuildCurrentHostForOutOfProc(String dotNetSdkPath) at Stride.Core.Assets.PackageSessionPublicHelper.FindAndSetMSBuildVersion() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSessionPublicHelper.cs:line 75 at Stride.GameStudio.Program.Startup(UFile initialSessionPath) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\editor\Stride.GameStudio\Program.cs:line 221

@Eideren
Copy link
Collaborator

Eideren commented Jun 18, 2024

Best to create a new issue specifically for this since it's a different error. But while we're here, it looks like you have dotnet x86 installed instead of x64, uninstall x86 and install x64 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants