Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Errors while creating service proxy with ohNetGen
28-10-2014, 09:33 AM
Post: #1
Errors while creating service proxy with ohNetGen
Hi all,

I want to create a proxy for the ContentDirectory service on my sonos. I use this command line:

Code:
OhNetGen.exe --language=cs --stack=cp --xml=c:\myDir\ContentDirectory1.xml --output=c:\myDir --domain=myDomain.org --type=ContentDirectory --version=1

And I obtain this exception whatever I try to change:

Quote:Exception non gérée : Mono.Options.OptionException: Error: Found 3 option values
when expecting 2.
à Mono.Options.OptionSet.ParseValue(String option, OptionContext c)
à Mono.Options.OptionSet.Parse(String argument, OptionContext c)
à Mono.Options.OptionSet.Parse(IEnumerable`1 arguments)
à Mono.TextTemplating.TextTransform.Main(String[] args)

Any ideas ?

Thx by advance

yann
Find all posts by this user
28-10-2014, 12:04 PM
Post: #2
RE: Errors while creating service proxy with ohNetGen
OhNetGet appears to be sensitive to placement of the template (CpUpnpCs.tt). Can you try invoking it from the ohNet directory? That fixed things for me.

If you confirm that fixes your problem, I'll have a look at making OhNetGen handle being run from other locations.
Find all posts by this user
28-10-2014, 02:39 PM
Post: #3
RE: Errors while creating service proxy with ohNetGen
I run it from the t4 directory inside the folder I got when I unzipped the archive. Therefore the path is "ohNet-1.0.1313-Windows-x64-Debug\ohNet-Win
dows-x64-Debug\lib\t4\". The template is in the same directory. I tried to run it from every folder in the path, doesn't get any better.

Should I change something ?
Find all posts by this user
28-10-2014, 02:43 PM
Post: #4
RE: Errors while creating service proxy with ohNetGen
(28-10-2014 02:39 PM)Yann Wrote:  I run it from the t4 directory inside the folder I got when I unzipped the archive. Therefore the path is "ohNet-1.0.1313-Windows-x64-Debug\ohNet-Win
dows-x64-Debug\lib\t4\". The template is in the same directory. I tried to run it from every folder in the path, doesn't get any better.

Should I change something ?

I think it'll only currently run from the root of a source checkout of ohNet.

Alternatively, you could run TextTransform.exe directly using something like
Code:
TextTransform.exe -o [full_path]/CpMyDomainOrgContentDirectory1.cs [full_path]/CpUpnpCs.tt -a "xml:[full_path]/ContentDirectory1.xml" -a domain:myDomain.org -a type:ContentDirectory -a version:1
Find all posts by this user
28-10-2014, 02:52 PM
Post: #5
RE: Errors while creating service proxy with ohNetGen
When I execute

Code:
TextTransform.exe -o [full_path]/CpMyDomainOrgContentDirectory1.cs [full_path]/CpUpnpCs.tt -a "xml:[full_path]/ContentDirectory1.xml" -a domain:myDomain.org -a type:ContentDirectory -a version:1

I got exactly the same error as when executing ohNetGen. Doesn't it miss something in front of the template name ?
Find all posts by this user
28-10-2014, 02:53 PM
Post: #6
RE: Errors while creating service proxy with ohNetGen
(28-10-2014 02:52 PM)Yann Wrote:  When I execute

Code:
TextTransform.exe -o [full_path]/CpMyDomainOrgContentDirectory1.cs [full_path]/CpUpnpCs.tt -a "xml:[full_path]/ContentDirectory1.xml" -a domain:myDomain.org -a type:ContentDirectory -a version:1

I got exactly the same error as when executing ohNetGen. Doesn't it miss something in front of the template name ?

Are you substituting [full_path] for paths to these files in your local setup?
Find all posts by this user
28-10-2014, 03:02 PM (This post was last modified: 28-10-2014 03:06 PM by Yann.)
Post: #7
RE: Errors while creating service proxy with ohNetGen
(28-10-2014 02:53 PM)simonc Wrote:  Are you substituting [full_path] for paths to these files in your local setup?

Yes I do and that's the problem Smile My path is like "c:\myFolder\" and the option parser does not like
Code:
-a "xml:c:\myFolder\etc.".

I changed it for

Code:
-a "xml:..\..\..\myFolder\etc."

and everything worked. Maybe having all in the same folder make it easier Smile

Thanks for the help!
Find all posts by this user
31-10-2014, 06:18 PM
Post: #8
RE: Errors while creating service proxy with ohNetGen
(28-10-2014 03:02 PM)Yann Wrote:  Yes I do and that's the problem Smile My path is like "c:\myFolder\" and the option parser does not like
Code:
-a "xml:c:\myFolder\etc.".

I changed it for

Code:
-a "xml:..\..\..\myFolder\etc."

and everything worked. Maybe having all in the same folder make it easier Smile

Thanks for the help!

I have found it works on Windows only if there is no drive letter at the start of the path.
Find all posts by this user


Forum Jump: