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

Support VS2019 with the client code generator #1485

Closed
weitzhandler opened this issue Jun 7, 2019 · 18 comments
Closed

Support VS2019 with the client code generator #1485

weitzhandler opened this issue Jun 7, 2019 · 18 comments
Labels
client only related to OData.Client
Milestone

Comments

@weitzhandler
Copy link
Contributor

The latest version (7.5.0) of the OData v4 Client Code Generator extension doesn't not support VS2019.
Can you please enable that?

Thank you!

@cilerler
Copy link

cilerler commented Jul 1, 2019

@mikepizzo Why we always end up short on the client side of the OData (javascript, blazor, vscode, vs2019) Would you mind discussing this subject on your next meeting, please? Thank you very much in advance 🙏

@raheph would you; please make this priority since It will not take more than 5-minute to fix

When I update files in VSIX as below

extension.vsixmanifest

  <Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0, 17.0)" />
  </Installation>
  <Prerequisites>
    <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,17.0)" DisplayName="Visual Studio core editor" />
  </Prerequisites>

manifest.json

    "dependencies": {
        "Microsoft.VisualStudio.Component.CoreEditor": "[15.0,17.0)"
    }

it throws

7/1/2019 6:48:24 AM - Beginning to install extension to Visual Studio Enterprise 2019...
7/1/2019 6:48:31 AM - Install Error : Microsoft.VisualStudio.ExtensionManager.MissingReferencesException: This extension cannot be installed because the following references are missing:
-Microsoft.VisualStudio.Component.CoreEditor (Microsoft.VisualStudio.Component.CoreEditor)
   at Microsoft.VisualStudio.ExtensionManager.EngineUtilities.EnsureNoMissingReferences(IEnumerable`1 missingRefs)
   at Microsoft.VisualStudio.ExtensionManager.PackageInstaller.PrepareEngineInstall(IDependencyGraph dGraph, IDependencyComparisonSeed seed, Component vsixComponent, Boolean isProductComponent, Int32& totalInstallationSteps)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.PerformSetupEngineInstall(InstallableExtensionImpl extension, Boolean installPerMachine, Boolean isPackComponent, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, IInstalledExtensionList modifiedInstalledExtensionsList, IProgress`1 progress, InstallFlags installFlags, AsyncOperation asyncOp, Version targetedVsVersion, IInstalledExtension& newExtension)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.InstallInternal(InstallableExtensionImpl extension, InstallFlags installFlags, IDictionary`2 extensionsInstalledSoFar, List`1 extensionsUninstalledSoFar, IInstalledExtensionList modifiedInstalledExtensionsList, AsyncOperation asyncOp, IProgress`1 progress, Version targetedVsVersion)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.BeginInstall(IInstallableExtension installableExtension, InstallFlags installFlags, AsyncOperation asyncOp, Version targetedVsVersion)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.InstallWorker(IInstallableExtension extension, InstallFlags installFlags, AsyncOperation asyncOp)

I found the same issue in here dotnet/project-system#4462 but no luck about fixing it.

🥇 Finally figured it out, there was one missing place.

catalog.json

            "dependencies": {
                "Microsoft.VisualStudio.Component.CoreEditor": "[15.0,17.0)"
            },

Well, it worked but still, it had better fix it in the source code.

@negue
Copy link

negue commented Nov 20, 2019

I changed all places like explained by @cilerler but its still not able to install it

@cilerler
Copy link

cilerler commented Nov 21, 2019

Remove the .zip part, and try this one, please.

ODataT4ItemTemplate.7.5.1.vsix.zip

@negue
Copy link

negue commented Nov 22, 2019

Worked, thanks!

@1Jesper1
Copy link

1Jesper1 commented Feb 28, 2020

Thanks, it works! Please upload a Visual Studio 2019 version to the marketplace https://marketplace.visualstudio.com/items?itemName=bingl.ODatav4ClientCodeGenerator

@mikepizzo mikepizzo added this to the 7.6.2 milestone Feb 28, 2020
@cfeilen
Copy link

cfeilen commented Mar 11, 2020

Any plan to get this updated on the Marketplace?

@paulodero
Copy link
Contributor

paulodero commented Mar 12, 2020

@cfeilen You could also consider using OData Connected Service for code generation and it currently supports VS 2019.

@paulodero
Copy link
Contributor

@weitzhandler The recommended code generator tool is now OData Connected Service which has all the features available in OData Client Code Generator.In addition it has support for VS 2019. We will therefore close this issue. Please register an issue in Connected Service Repo incase you face challenges.

@weitzhandler
Copy link
Contributor Author

Thank you for the update, and thank you and the rest of the team for the great effort ❤

As a LoB app developer, OData has always been one of the most important parts in programming to me. I'm super excited to see OData is reviving, and hopefully will soon become as what RIA services used to be in those days.

Anyway, if I may ask, back at the day, I got recommendations here to use Simple.OData.Client or other clients and generators out there.
Now, since Microsoft has recently started taking care of OData client-side, and especially since Simple.OData.Client is pretty neglected and dead, did the current recommendation switch to this extension? See also my question here.

@paulodero
Copy link
Contributor

@weitzhandler Thanks for the feedback. Yes, it is recommended to use Microsoft OData Connected Service and Microsoft.OData.Client for your client development since we are committed in supporting these libraries going forward.

@1Jesper1
Copy link

@paulodero Do you know if this problem exist when using OData Connected Service? #1396

@ebekker
Copy link

ebekker commented Mar 30, 2020

Is there any tooling (Client Code Generator, Connected Service, something else?) that supports generating the client model/proxies from a command line or CI build (i.e. non-UI driven)?

@KanishManuja-MS
Copy link
Contributor

@ebekker You can try something along the lines of this - https://romiller.com/2013/05/15/running-ef-t4-code-generation-templates-from-command-line/

Basically, the code generator is a TT4 tool. You can try using TextTransform.exe to run it from command line. Do let us know how that worked out.

@ebekker
Copy link

ebekker commented Apr 1, 2020

Funny you mention that -- along the same lines I've already been expanding upon the EFCore.TextTemplating project from @bricelam -- it's a T4-based version of the EF Core scaffolding tooling. I've used it to generate the EF Core model along with context and related components.

The OData piece is related to (and derived from) that, so I guess I can just pull in the related template code from the Connected Service project.

@mkalinovTC
Copy link

@weitzhandler The recommended code generator tool is now OData Connected Service which has all the features available in OData Client Code Generator.In addition it has support for VS 2019. We will therefore close this issue. Please register an issue in Connected Service Repo incase you face challenges.

The connected service fails on big metadata files. Code generator still can process them. Shame we don't have it in vs2019

@ElizabethOkerio
Copy link
Contributor

@mkalinovTC you can try the OData Cli. You can try the dotnet tool https://www.nuget.org/packages/Microsoft.OData.Cli/ or the exe: https://www.nuget.org/packages/Microsoft.OData.Cli.Exe whichever that works for you.

@ElizabethOkerio
Copy link
Contributor

Also, when working with huge metadata files in the connected service, there is an option to split the huge file into multiple files: Check out this https://learn.microsoft.com/en-us/odata/connectedservice/generating-multiple-files on how to use the feature.

@mkalinovTC
Copy link

Thanks @ElizabethOkerio

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

No branches or pull requests