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

VS Community 2022 v17.9.0 #308

Open
tgstyle opened this issue Feb 13, 2024 · 44 comments
Open

VS Community 2022 v17.9.0 #308

tgstyle opened this issue Feb 13, 2024 · 44 comments
Assignees
Labels

Comments

@tgstyle
Copy link

tgstyle commented Feb 13, 2024

After updating to the latest version of VS Community 2022, I can no longer deploy scripts. It gives the following error -

MDK.Build.BuildException: Error loading script projects from O:\Downloads\Programs\VS\Scripts\Scripts.sln ---> System.InvalidOperationException: Unable to locate the .NET Framework build host at c:\program files\microsoft visual studio\2022\community\common7\ide\commonextensions\microsoft\vbcsharp\languageservices\BuildHost-net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.exe - line 206
at Roslyn.Utilities.Contract.Fail(String message, Int32 lineNumber)
at Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager.GetPathToDotNetFrameworkBuildHost()
at Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager.CreateDotNetFrameworkBuildHostStartInfo()
at Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MDK.Build.BuildModule.d__26.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\Build\BuildModule.cs:line 131
--- End of inner exception stack trace ---
at MDK.Build.BuildModule.d__26.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\Build\BuildModule.cs:line 138
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MDK.Build.BuildModule.<b__25_0>d.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\Build\BuildModule.cs:line 117
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MDK.MDKPackage.d__47.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\MDKPackage.cs:line 369

@malware-dev
Copy link
Owner

Thank you for letting me know so quickly. Hopefully it's merely a matter of updating packages and rebuilding. I will do my best to remember doing just that when I get home from work.

@malware-dev malware-dev self-assigned this Feb 14, 2024
@malware-dev
Copy link
Owner

Unfortunately MS has been having some build issues today, and it would seem this is affected some of the packages I need for MDK too. Which means I won't be able to fix this before they fix their part. I will try to monitor.

@malware-dev malware-dev pinned this issue Feb 14, 2024
@tgstyle
Copy link
Author

tgstyle commented Feb 14, 2024

Thanks for the updates on the status.

@Ronzan
Copy link

Ronzan commented Feb 15, 2024

I get this error too.
Are there any workarounds we can use?

@malware-dev
Copy link
Owner

Well, they fixed the packages. But they've broken something else I can't figure out just yet. Working on it.

@Ronzan
Copy link

Ronzan commented Feb 15, 2024

Thank you much appreciated.

@malware-dev
Copy link
Owner

I am sorry to say, that even after hacking my way around what they broke, and installing all new packages etcetera...

the original problem, with the build failing, remains. This is a bigger problem than I thought.

@malware-dev
Copy link
Owner

I just wanted to let you guys know that while I have not been able to solve the actual issue (MS has deleted something), I am working on a way around it. At this moment I can't say how much time it'll take, but I promise I'm doing my best.

@Ronzan
Copy link

Ronzan commented Feb 17, 2024

Great, thank you so much :)

@malware-dev
Copy link
Owner

I just found out that Microsoft has significantly simplified the process of rolling back Visual Studio. If this is an option for you, you can open your Visual Studio installer and find the Roll Back menu item under the More button.

This might tide you guys over until I either figure out how to solve what they broke, or finish MDK2... one of the two.

@tgstyle
Copy link
Author

tgstyle commented Feb 17, 2024

I saw that too. Unfortunately, trying to troubleshoot the issue. I removed and reinstalled VS completely. So, I don't have that option. Thanks for your work on this.

@Ronzan
Copy link

Ronzan commented Feb 17, 2024

Thanks for the tip - I thought that was for non-community editions only :)
I might give that a try.

@Ronzan
Copy link

Ronzan commented Feb 18, 2024

Unfortunately I don't have that "Roll Back" option under the "More" menu.
I can't seem to find a way to download specific versions of VS Community edition, looks like that is a pro/enterprise feature.
Am I missing something?
Also please let me know if there is anything I can do to help :)

@malware-dev
Copy link
Owner

malware-dev commented Feb 18, 2024

It's not a pro/enterprise feature. I run Community Edition at home specifically to make sure I don't do something that requires a paid VS version.

I very much appreciate the offer to help, but right now I just need to write code.

At this moment I don't know any other solution but to finish MDK2 - which is not integrated with Visual Studio at all, and as such doesn't suffer from this issue.

At least, my goal no. 1 is to get the deployer console app complete enough that you guys can use it as a workaround for the missing deploy in MDK1, then I will have a second look on whether I can actually fix it somehow. Since it'll definitely be a while until MDK 2 is fully complete.

@Ronzan
Copy link

Ronzan commented Feb 18, 2024

Thanks again, I really appreciate your work and effort.

This is what it looks like for me:
vs2022missing_rollback

Am I doing something wrong here?

@malware-dev
Copy link
Owner

As far as I'm aware, like tgstyle noticed, you will only get this option if you've just updated your VS. If you've done anything else - if this is a new install, for instance - you don't get the rollback.

@Ronzan
Copy link

Ronzan commented Feb 18, 2024

Yeah that is unfortunate. I did actually just update, but it was from a very old version.
Thanks again malware.

@malware-dev
Copy link
Owner

Please vote:
https://developercommunity.visualstudio.com/t/Something-got-deleted-when-VS-updated-b/10598067

While I am still working on MDK2 - and the tool required to work around this is almost ready - the best solution for existing users would be to have this fixed, as MDK2 is quite a different kind of beast.

@Ronzan
Copy link

Ronzan commented Feb 27, 2024

Thanks for the update - voted.

@malware-dev
Copy link
Owner

malware-dev commented Mar 3, 2024

There is now a nuget package early alpha of the MDK2 packager.

Mal.Mdk2.PbPackager

This should be deploying your scripts every time you build.

Of course, being an early alpha, it's likely riddled with problems.

Please make issues prefixed with [MDK2] - I will take both suggestions and bug reports at this time.

I am dependent on whoever may be willing to help.

Some limited instructions are available at https://www.nuget.org/packages/Mal.Mdk2.PbPackager/

@mkaito
Copy link

mkaito commented Mar 3, 2024

I'm sure this wasn't planned, but it works with Rider too, which makes me happy.

@malware-dev
Copy link
Owner

I'm sure this wasn't planned, but it works with Rider too, which makes me happy.

It was absolutely planned. Rider is my primary.

@Ronzan
Copy link

Ronzan commented Mar 4, 2024

Thanks @malware-dev - it works as intended, at least for my simple projects, I haven't tested more exotic scenarios but for the basics it works.

@malware-dev
Copy link
Owner

Make sure you update to at least Alpha 31. There was a rather ugly infinite-loop bug in 30.

@AnalogContent
Copy link

so sorry new to all this got visual studio installed and sorted getting same bug as every one at listed at top ,
i have read the instructions at https://www.nuget.org/packages/Mal.Mdk2.PbPackager/
i understand them fully , but what do i do with the file Mal.Mdk2.PbPackager , never used anything like this before i guess it just a patch or something

@malware-dev
Copy link
Owner

https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio

@malware-dev
Copy link
Owner

It is not a patch. I cannot fix the built-in deploy.

I am still working on MDK2 which this workaround is a part of, and will eventually supercede MDK1 completely.

@AnalogContent
Copy link

AnalogContent commented Mar 7, 2024

cheers malware thank you,

**Update all sorted now thank you for pointing me in right direction

@malware-dev
Copy link
Owner

Please help me decide how MDK2 should be configured

If you use the new workaround MDK2 package, please answer this poll:

https://strawpoll.com/3RnYl5ERBye

@mkaito
Copy link

mkaito commented Mar 12, 2024

Any chance you could default to Lite minify or similar until you get a chance to make it configurable?

@malware-dev
Copy link
Owner

malware-dev commented Mar 12, 2024

There is no minifier at all yet.

I'm sorry, I'm doing my best here, but I do have a day job as well 😄

@malware-dev
Copy link
Owner

To explain:

In order for me to move on to the minifiers (which do need to be rewritten for MDK2) I need to nail down the basic function of how the program itself needs to work. I'm not quite there yet.

@mkaito
Copy link

mkaito commented Mar 12, 2024

Oh, all good. Don't mind me 😁

@kelno
Copy link

kelno commented Apr 14, 2024

Just joined the SE scripting party, MDK2 works well for me, it just failed the first build then started working.

@malware-dev
Copy link
Owner

Just joined the SE scripting party, MDK2 works well for me, it just failed the first build then started working.

May I ask what the first failure was?

@Aimonxxl
Copy link

I would like to receive detailed instructions on how to install alpha MDK2

@malware-dev
Copy link
Owner

malware-dev commented Apr 15, 2024

I would like to receive detailed instructions on how to install alpha MDK2

Presuming you are using this to work around the problems with MDK1:

Right-click your MDK1 project
Select "Manage Nuget Packages"
Find the search field. To the right of it, there's a checkbox named "Include prerelease". Check it, then type in Mal. in the search field.
Install the Mal.Mdk2.PbPackager package in your project

Rebuild.

From now on, your script will be published every time you build, you will no longer need to use the Publish function.

@jpangburn
Copy link

Just joined the SE scripting party, MDK2 works well for me, it just failed the first build then started working.

May I ask what the first failure was?

I just installed Visual Studio 2022 Community, followed your Getting Started started directions, followed the "Install the Mal.Mdk2.PbPackager package in your project" directions, and hit the "Build Solution" button and got the error that I assume @kelno got. It was the following:

Severity	Code	Description	Project	File	Line	Suppression State
Error		The command ""C:\Users\jesse\source\repos\TheMaw\packages\Mal.Mdk2.PbPackager.2.0.0-alpha073\build\..\tools\mdk.exe" restore "C:\Users\jesse\source\repos\TheMaw\TheMaw\TheMaw.csproj" -interactive" exited with code -1.	TheMaw	C:\Users\jesse\source\repos\TheMaw\packages\Mal.Mdk2.PbPackager.2.0.0-alpha073\build\Mal.Mdk2.PbPackager.props	33	

If I just hit the "Build Solution" button again, the error goes away and the script is successfully deployed. This is so easy! Thank you! In the game I just Browse Scripts, select my script, and hit Copy to Editor button and it's ready to rock.

@kelno
Copy link

kelno commented May 9, 2024

Sorry I missed the question. I don't remember now. But I definitely only had to just hit build a second time to make it go away. Good chance it's the same one described in last message.

@malware-dev
Copy link
Owner

@jpangburn @kelno It would be great to get the actual error output from that (not the Error list, but the build output)

@kelno
Copy link

kelno commented May 10, 2024

Here goes, I reinstalled everything on a new computer.
I did create a new project, tried to build and failed. Then installed the new nugget package via the package manager. Then hit build and got:

1>------ Build started: Project: IngameScript2, Configuration: Debug x64 ------
1>  MDK is converting legacy ingame script project: IngameScript2
1>  The project has been successfully converted to MDK2.
1>  The Mal.Mdk2.PbPackager nuget package could not be found on the nuget web site.
1>C:\Users\Patipa\source\repos\IngameScript2\packages\Mal.Mdk2.PbPackager.2.0.0-alpha073\build\Mal.Mdk2.PbPackager.props(33,9): error MSB3073: The command ""C:\Users\Patipa\source\repos\IngameScript2\packages\Mal.Mdk2.PbPackager.2.0.0-alpha073\build\..\tools\mdk.exe" restore "C:\Users\Patipa\source\repos\IngameScript2\IngameScript2\IngameScript2.csproj" -interactive" exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 11:08 and took 01,486 seconds ==========

Then it worked on second build.

@malware-dev
Copy link
Owner

Thank you very much, @kelno .

@malware-dev
Copy link
Owner

@kelno @jpangburn This looks to me to be directly related to the hybrid solution currently in use, the attempt to make it auto-upgrade MDK1 projects enough that MDK2 can run. Since it "corrects itself" I don't think I'm gonna spend any time on trying to fix it, unless it starts causing real issues.

@Truetech000
Copy link

work around for the initial bug that broke MDK1

#323 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants