OData / odata.net

ODataLib: Open Data Protocol - .NET Libraries and Frameworks
https://docs.microsoft.com/odata
Other
686 stars 349 forks source link

OData Client T4 Template ver. 7.5.0 fails to run with Microsoft.VisualStudio.TextTemplating.Engine #1217

Open francisharvey opened 6 years ago

francisharvey commented 6 years ago

Here's the stack trace:

An exception was thrown while trying to compile the transformation code. The following Exception was thrown: System.ArgumentException: Empty path name is not legal. at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Roslyn.Utilities.FileUtilities.OpenFileStream(String path) at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation) at Microsoft.VisualStudio.TextTemplating.CompilerBridge.<>c.<.ctor>b__15_0(String x) at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Enumerable.d671.MoveNext() at System.Linq.Enumerable.d671.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable1 items) at Microsoft.CodeAnalysis.ImmutableArrayExtensions.AsImmutableOrEmpty[T](IEnumerable1 items) at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable1 references) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable1 references) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonWithReferences(IEnumerable1 newReferences) at Microsoft.VisualStudio.TextTemplating.CompilerBridge.PrepareNewCompilation() at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Compile() at Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(String source, String inputFile, IEnumerable1 references, Boolean debug, SupportedLanguage language, String compilerOptions)

I have followed the walkthrough here: https://msdn.microsoft.com/en-us/library/bb126579.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2

Any idea how to make this work? Thanks

francisharvey commented 6 years ago

Should the information in the ODataClient.tt like MetadataDocumentUri need be passed to the host using the a TextTemplatingSession and ITextTemplatingSessionHost interface?

If it works in Visual Studio, should it also works with the TextTemplating.Engine?