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

Adding OData-Service to legacy .NET Framework project fails with: "Value does not fall within the expected range." #340

Open
GandalfClashs opened this issue Feb 18, 2023 · 0 comments
Assignees

Comments

@GandalfClashs
Copy link

Related to #137

Describe the bug

When I try to add an OData-Service to a legacy .NET Framework project, which already has a Service Reference to a WCF Service, i get the error message "Value does not fall within the expected range." after "Generating Client Proxy for OData V4...".

Version of the Project affected

ODataConnectedService 2022+ v1.0.0 and earlier
VisualStudio Version v17.4.5
Microsoft.Odata.Client v7.14.1

To Reproduce

Steps to reproduce the behavior:

  1. Create a new .NET Framework console project
  2. Add a folder named "Service References" to the project
  3. Replace "Folder" with "WCFMetadata" for the created folder in the project file:
<ItemGroup>
  <WCFMetadata Include="Service References\" />
</ItemGroup>
  1. Reload the project
  2. Add an OData-Service with the ODataConnectedService wizard (e.g. https://services.odata.org/V4/Northwind/Northwind.svc/$metadata) and leave all settings in the wizard on default

Expected behavior

The OData-Service is added successfully.

Actual behavior

The addition of the service to the project fails.

Additional context

The folder name "Connected Services" is hard-coded in the ConnectedServiceFileHandler. In legacy projects the services root folder doesn't always have this name.

@habbes habbes self-assigned this Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants