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

Update CodeGeneratorUtils.cs #68

Closed
wants to merge 1 commit into from
Closed

Conversation

mohsenno1
Copy link
Contributor

@mohsenno1 mohsenno1 commented Sep 26, 2017

PR addresses issue #64, where

The "OData Connected Service" wizard invariably fails in the "Finish" step with this error message: "Adding OData Connected Service to the project failed: Value cannot be null. Parameter name: path1".

Problem:

I have the same problem.
Visual Studio 2017 Community 15.2.

I tried to debug it using another instance of visual studio. I got this error:

Could not load file or assembly 'Microsoft.VisualStudio.ConnectedServices.Package2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
And, Right after it I got:

"Value cannot be null.\r\nParameter name: path1"

I found a temporary solution:
Go to registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft WCF Data Services]

I my case I found VS 2010 Tooling key.
I made a duplicate of that key and renamed it to VS 2014 Tooling.

Now it's working fine.

But this problem can be solved easily by changing the source code:

In V3CodeGenDescriptor.cs#L32 just needs to be checked that if string.IsNullOrEmpty(wcfDSInstallLocation) and if it is then jump to the else statement.

And this will fix the bug.

Copy link
Contributor

@AlanWong-MS AlanWong-MS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a quick comment update.

@@ -31,7 +31,7 @@ public static string GetWCFDSInstallLocation()
}
}

return null;
return String.Empty;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Before we merge, can you please update the comment at line 16? It should say that we're returning String.Empty instead of null with your update.

@xuzhg
Copy link
Member

xuzhg commented Oct 19, 2017

merged at: 196d8b8

@xuzhg xuzhg closed this Oct 19, 2017
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

Successfully merging this pull request may close these issues.

5 participants