NeVeSpl / NTypewriter

File/code generator using Scriban text templates populated with C# code metadata from Roslyn API.
https://nevespl.github.io/NTypewriter/
MIT License
126 stars 24 forks source link

NTypeWriter Extension 0.5.9 expecting OriginalDefinition for CustomFunction, but NTypeWriter.CodeModel is only 0.5.8 #126

Open ndollesin-prismhr opened 1 month ago

ndollesin-prismhr commented 1 month ago

Using the latest version of the extension (installed via visual studio) is causing a rendering failed issue for custom functions that implement IType:

error CS0535: 'CustomFunction.WrappedType' does not implement interface member 'IType.OriginalDefinition'

However, OriginalDefinition is not available on the current 0.5.8 version of NTypeWriter.CodeModel.

There does not seem to be a way to roll back to NTypeWriter 0.5.8, nor is there a newer version of the CodeModel to update the package to.

NeVeSpl commented 1 month ago

That is interesting, are you using the NT source generator in that project too?

ndollesin-prismhr commented 1 month ago

Yes @NeVeSpl, that is correct

NeVeSpl commented 1 month ago

I have released version 0,5.9.1 of VS add-in, could you check if that helps? If not, the NT source generator will be released soon with matching dlls versions.

The problem is that both VS add-in and source generator are loaded and running in the same VS app domain. dlls are strongly signed so it should work even when different versions of the same assembly are loaded in the app domain...

ndollesin-prismhr commented 1 month ago

Appreciate the speedy updates and insight.

Looks like 0.5.9.1 still throws the same error: error CS0535: 'CustomFunction.WrappedType' does not implement interface member 'IType.OriginalDefinition'

And OriginalDefinition is still unavailable.

rhilton66 commented 1 month ago

Not sure if this has any bearing on this issue but I did notice that the vsix file for 0.5.8 was 17.7MB and the vsix file for 0.5.9 was only 3.9MB. Was something missing from the new version.

NeVeSpl commented 1 month ago

Not sure if this has any bearing on this issue but I did notice that the vsix file for 0.5.8 was 17.7MB and the vsix file for 0.5.9 was only 3.9MB. Was something missing from the new version.

It was caused by updating Microsoft.VSSDK.BuildTools nuget from 17.7.2196 to 17.11.435. Much fewer files are now included in the vsix file, and it looks like DLLs distributed with VS are no longer included in the vsix file after the update.

NeVeSpl commented 1 month ago

The v0.5.9 nuggets and source generator have been published. They should match the ones used by the latest version of the VS add-in, and solve this problem.