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

Extension fails to work in 15.8 Preview 3 #127

Open
CoolDadTx opened this Issue Jun 29, 2018 · 18 comments

Comments

Projects
None yet
7 participants
@CoolDadTx
Copy link

CoolDadTx commented Jun 29, 2018

Taking a simple script and trying to run the custom tool via the extension in 15.8 Preview 3 fails. The error is:
System.TypeLoadException: Could not load type 'Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace' from assembly 'Microsoft.CodeAnalysis.Workspaces.Desktop, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at Scripty.Core.ScriptEngine.d__6.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at Scripty.Core.ScriptEngine.Evaluate(ScriptSource source)
at Scripty.ScriptyGenerator.GenerateCode(String inputFileContent) in E:\Code\Scripty\src\Scripty.CustomTool\ScriptyGenerator.cs:line 58

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class AppSettings
{
}
@daveaglick

This comment has been minimized.

Copy link
Owner

daveaglick commented Jun 29, 2018

I'm not totally surprised. Scripty is a little behind the times right now. I've been working a ton over in https://github.com/daveaglick/Buildalyzer to make sure I can build any type of project from any type of host. That project serves as a foundation for Scripty and is important because being able to build the host project so that we can introspect it is the fundamental goal of Scripty. Once that project is stable enough, I'm going to circle back to Scripty and update it for the most recent versions of MSBuild and Roslyn.

@MelGrubb

This comment has been minimized.

Copy link

MelGrubb commented Jul 25, 2018

The Visual Studio extenstion seems to be entirely missing at this point. Is this related? I just ran into a limitation with a set of T4 templates that I've used for years, and was looking for some way to keep them alive in the .Net Core space. That doesn't look possible, so I thought I'd rewrite them in Scripty. I'm not getting anything though. No output or complaints from the MSBuild NuGet package. Nothing. I'd like to try the extension, but it's seemingly AWOL at the moment.

@daveaglick

This comment has been minimized.

Copy link
Owner

daveaglick commented Jul 25, 2018

Sorry about that. I removed it for now. Scripty is in need of an update (which I fully intend to do sometime this year), but in the meantime there were reports of the vsix breaking Visual Studio. Since I don't have time to look closer at it right now, I unlisted the package lest it get swamped with bad reviews. The MSBuild package should still work though, and you could build the vsix from source and locally install it if you really need to.

If you're not seeing anything from the build output and Scripty isn't generating files, perhaps you're in a newer scenario I haven't tested yet. Are you using a SDK-style project or is it .NET Core? Those will be supported in the future, but I honestly don't know how well they'll work right now.

Keep an eye out for a new Scripty rewrite, probably sometime in the last couple months of the year.

@MelGrubb

This comment has been minimized.

Copy link

MelGrubb commented Jul 25, 2018

@dude0001

This comment has been minimized.

Copy link

dude0001 commented Aug 20, 2018

Can you put the extension back up on the marketplace, or can you provide an alternate link to download the extension? Removing the extension has essentially crippled anyone still using this in VS versions prior to 15.8. We are still using this on production environments and we need to be able to set this up on new development machines using an older VS version for those that have updated to 15.8. I'm scrambling today to try to find a machine that hasn't been updated to VS 15.8 and has the extension installed.

Regarding the actual issue, it looks like MS actually broken multiple packages that use MSBuildWorkspace and they have fixed the issue. It looks simple as just updating this new version dotnet/roslyn#29334

@daveaglick

This comment has been minimized.

Copy link
Owner

daveaglick commented Aug 20, 2018

@dude0001

Removing the extension has essentially crippled anyone still using this in VS versions prior to 15.8

Definitely don't want to cause problems for existing Scripty users. I know it's been a long time since an update, but I'm still planning on updating and rewriting Scripty for a 1.0 release soonish (I swear!) Some of the pieces like Buildalyzer are finally falling into place.

Can you put the extension back up on the marketplace, or can you provide an alternate link to download the extension?

I'm very hesitant to add it back to the gallery since there's been reports of breaks and I can't guarantee it'll work on newer versions of Visual Studio at this point. However, I've added the VSIX to the 0.7.4 release here on GitHub so anyone who needs/wants it can download it until the next release gets added back to the gallery.

Regarding the actual issue, it looks like MS actually broken multiple packages that use MSBuildWorkspace and they have fixed the issue.

At this point, MSBuildWorkspace is a non-started for Scripty use. It was totally broken for a long time (hence my break here to focus on Buildalyzer), and still remains broken for all but the most simple scenarios. For example, it doesn't work at all under a .NET Core host. Buildalyzer resolves some of these issues (though it's not perfect), so the next version of Scripty will use it and a Roslyn AdhocWorkspace instead of MSBuildWorkspace.

@dude0001

This comment has been minimized.

Copy link

dude0001 commented Aug 20, 2018

Thank you for the link to the VSIX, didn't think to look there. I think that will help us work around this for now but very much looking forward to a fix so we can continue to use Scripty.

@alphaleonis

This comment has been minimized.

Copy link

alphaleonis commented Sep 27, 2018

I encountered the same error on one of my own extensions. Apparently there doesn't seem to be a good way to make an extension that is compatible with both 15.8 and earlier versions. See dotnet/roslyn#29334 for more info.

(As a summary, they moved the MSBuildWorkspace into a new assembly without type forwarding, which requires us to reference the 2.9.0 version of Microsoft.CodeAnalysis assemblies to use it on VS 15.8)

@InvalidCast44

This comment has been minimized.

Copy link

InvalidCast44 commented Nov 2, 2018

any news please?

@daveaglick

This comment has been minimized.

Copy link
Owner

daveaglick commented Nov 2, 2018

@InvalidCast44 Nope.

My thinking is still about the same as it was - I'm still planning on circling back to Scripty at some point, though I don't have an estimate on when or how soon that'll be ("soonish" may have been a bit optimistic). I have other higher-priority OSS work at the moment that'll keep me busy into the immediate future.

@InvalidCast44

This comment has been minimized.

Copy link

InvalidCast44 commented Nov 2, 2018

i quickly tried to recompile your code, adding the new missing package "microsoft.codeanalysis.workspaces.msbuild" but i get this error in Scripty.CustomTool:

CreatePkgDef : error : ProvideBindingRedirectionAttribute: Invalid value specified for NewVersion.

i would like to have a "crappy" version of my own on my machine, but this block me.
any ideas?

@InvalidCast44

This comment has been minimized.

Copy link

InvalidCast44 commented Nov 3, 2018

i finally managed to get your extension work with vs 15.8.9 :-)
i had problems with vsix: i couldn't register custom tool
i created another vsix:

  • with vsix template
  • add Microsoft.VisualStudio.TextTemplating.VSHost.15.0 package
  • add an async package via "new item"

and this time it worked.

so basically, adding "microsoft.codeanalysis.workspaces.msbuild" package is all you need to make scripty work again.
for the moment i will use my crappy extension, it does the job (thanks to your code obviously :-) )

@KCarterSr

This comment has been minimized.

Copy link

KCarterSr commented Nov 9, 2018

InvalidCast44 , can I get a copy of your vsix?

Thanks

@KCarterSr

This comment has been minimized.

Copy link

KCarterSr commented Nov 21, 2018

Anybody know how to get in touch with InvalidCast44. I need this baaad.

@InvalidCast44

This comment has been minimized.

Copy link

InvalidCast44 commented Nov 21, 2018

if it's ok with daveaglick i can post a link to download modified sources + compiled vsix

@daveaglick

This comment has been minimized.

Copy link
Owner

daveaglick commented Nov 21, 2018

Fine with me - I really appreciate you filling in the gap until I’ve got time to revisit.

@InvalidCast44

This comment has been minimized.

Copy link

InvalidCast44 commented Nov 21, 2018

it's a little thing compared to what you've done for us ;-)
please remind that it's a quick fix, it was not intented to be released to anyone but me
http://dl.free.fr/b7ElBRNUC
contains modified git clone + compiled vsix
AFAIR i change some description string to be sure my version was the one that was registered.
but anyway, the most important is that custom tool "ScriptyGenerator" is still registered

@KCarterSr

This comment has been minimized.

Copy link

KCarterSr commented Nov 22, 2018

Man, thanks so much. Im fed up with tools for T4. All the good tools except for ForTea have gone bust. And ForTea takes soooo long for updates to come out each time Resharper is updated, I end up waiting for sometimes months before I can continue using it for my code.

K. L. Carter Sr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment