Open vendettamit opened 1 year ago
@vendettamit this extension- [VS2022](https://marketplace.visualstudio.com/items?itemName=marketplace.ODataConnectedService2022)
should be installed in visual studio 2022
and this extension - https://marketplace.visualstudio.com/items?itemName=marketplace.ODataConnectedService should be installed in visual studio 2019 or 2017.
Is it Reference.cs
that is not working? or did you generate .tt files that you are working with?
I get the same issue when I added the tt files into the solution.
System.IO.FileNotFoundException: Could not find file 'D:\TestProjects\ConsoleApp1\Microsoft.OData.ConnectedService.dll'.
File name: 'D:\TestProjects\ConsoleApp1\Microsoft.OData.ConnectedService.dll'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
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.StandardFileSystem.OpenFile(String filePath, FileMode mode, FileAccess access, FileShare share)
at Roslyn.Utilities.CommonCompilerFileSystemExtensions.OpenFileWithNormalizedException(ICommonCompilerFileSystem fileSystem, String filePath, FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
at Microsoft.VisualStudio.TextTemplating.CompilerBridge.<>c.<.ctor>b__15_0(String x)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Linq.Enumerable.<UnionIterator>d__67`1.MoveNext()
at System.Linq.Enumerable.<UnionIterator>d__67`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable`1 references)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable`1 references)
at Microsoft.VisualStudio.TextTemplating.CompilerBridge.PrepareNewCompilation()
at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Compile()
at Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(String source, String inputFile, IEnumerable`1 references, Boolean debug, SupportedLanguage language, String compilerOptions) ConsoleApp1 1
@vendettamit this extension-
[VS2022](https://marketplace.visualstudio.com/items?itemName=marketplace.ODataConnectedService2022)
should be installed invisual studio 2022
and this extension - https://marketplace.visualstudio.com/items?itemName=marketplace.ODataConnectedService should be installed in visual studio 2019 or 2017.Is it
Reference.cs
that is not working? or did you generate .tt files that you are working with?
The .tt file was added in the VS 2019 extension then we moved to 2022 and that's when this issue started happening. So I had to switch back to 2019 to generate by Reference.cs from the .tt file
Same description as @vendettamit, I have the same issue when running Visual Studio 2022, and the "OData Connected Service 2022+" version of this extension against a D365 Finance & Operations OData endpoint.
In VS2022, I deleted the OData Connected Service completely, and then re-added a new Connected Service, with the following Advanced Options selected:
Running the Reference.tt produces the error:
An exception was thrown while trying to compile the transformation code. The following Exception was thrown:
System.IO.FileNotFoundException: Could not find file '<SOLUTION_PATH_HERE>\Microsoft.OData.ConnectedService.dll'.
File name: '<SOLUTION_PATH_HERE>\Microsoft.OData.ConnectedService.dll'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
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.StandardFileSystem.OpenFile(String filePath, FileMode mode, FileAccess access, FileShare share)
at Roslyn.Utilities.CommonCompilerFileSystemExtensions.OpenFileWithNormalizedException(ICommonCompilerFileSystem fileSystem, String filePath, FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
at Microsoft.VisualStudio.TextTemplating.CompilerBridge.<>c.<.ctor>b__15_0(String x)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Linq.Enumerable.<UnionIterator>d__67`1.MoveNext()
at System.Linq.Enumerable.<UnionIterator>d__67`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable`1 references)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable`1 references)
at Microsoft.VisualStudio.TextTemplating.CompilerBridge.PrepareNewCompilation()
at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Compile()
at Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(String source, String inputFile, IEnumerable`1 references, Boolean debug, SupportedLanguage language, String compilerOptions)
Running VS 2019, as well as the older "OData Connected Service" extension, I can generate the Reference files/classes (but then also run into the #317 issue, for which it seems like there is a manual fix.)
My settings are like @parydnar as well. Using the older extension in VS2019 gets around the error for me, but is very annoying, specially I don't have VS2019 installed on all my workstations. So I end up committing and pulling to different workstations to keep going.
@jonantoine we are looking into this issue. But we have a cli tool that you can use - https://www.nuget.org/packages/Microsoft.OData.Cli/
@jonantoine we are looking into this issue. But we have a cli tool that you can use - https://www.nuget.org/packages/Microsoft.OData.Cli/
Is any other workaround available? Our use case requires T4 templates to customize property names, but I see no option to include T4 templates in Odata CLI.
@ElizabethOkerio We also have changed the T4 templates for better tracking of set properties.
Wonderful! When will this get released to the marketplace? I'm eager to see if this fixing our problem.
@ElizabethOkerio just wondering when this will get released to the marketplace? The marketplace says the last update was 2/3/2023.
@jantoineqci we'll do a release tomorrow.
@ElizabethOkerio Thank you, we updated our VS2022 Extension. We had to update the ODataT4CodeGenFilesManager.ttinclude file inside our solution, but now the t4 templates work inside VS2022!
After installing the connected services for VS2022 extension of connected service my Reference.tt stopped working. Getting error below:
I have this file on following locations but VS is not able to get the correction location. Any guidance would be really appreciated!!
Note: Installing the latest extension v1.0.0 on VS2019 also not generating anything also no throwing any error.