scriptcs / scriptcs-samples

Sample usages of scriptcs
Other
111 stars 26 forks source link

Nancy Sample does not work on mono #20

Open johnjelinek opened 9 years ago

johnjelinek commented 9 years ago
$ mono --version
Mono JIT compiler version 3.10.0 (tarball Wed Oct 22 10:09:38 BST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug
    LLVM:          supported, not enabled.
    GC:            sgen

I had to rename packages.config to scriptcs_packages.config to do scriptcs -install.

$ scriptcs start.csx
(12,94): error CS0246: The type or namespace name `CustomRouteDescriptionProvider' could not be found. Are you missing an assembly reference?
(17,15): error CS0246: The type or namespace name `PathProvider' could not be found. Are you missing an assembly reference?
/Users/jjelinek/Projects/restsharp-webapi-auth/start.csx(14,45): error CS0246: The type or namespace name `Bootstrapper' could not be found. Are you missing an assembly reference?
johnjelinek commented 9 years ago

I think the rename step is because of this commit: https://github.com/scriptcs/scriptcs/commit/0b4acc09de742bbb260529535f2ef5418ee72ed3

adamralph commented 9 years ago

@johnjelinek if you are using the latest nightly build, then yes, it has the renamed file system artifacts but it doesn't do the rename automatically. In that version, you can do the renaming by doing:-

scriptcs start.csx -Modules migrate

Note that we are taking another direction with this now and we anticipate that the 'migrate' module will be removed in 0.13 (and in a forthcoming nightly) and instead scriptcs will detect and auto-migrate for you (it will only make copies of the current artifacts instead of renaming, just in case they are being used for something else, e.g. a regular .NET solution).

As for the actual problem you are raising here, nothing springs to mind right now and I don't have time to investigate right now but if it is blocking you, you could try and use the Nancy script pack instead https://www.nuget.org/packages/ScriptCs.Nancy/ which, AFAIK, does work on Mono.

johnjelinek commented 9 years ago

I rolled back to v0.12 before that rename was required. Problem still exists. I decided to just do dev on Windows :/ -- neither webapiselfhost / nancy worked for me on mono. The script pack does work though on mono :) Thanks!

adamralph commented 9 years ago

0.12 works without the scriptcs_ prefix, so if you still needed it then your roll back must have failed.

johnjelinek commented 9 years ago

I didn't need to rename for v0.12. Had the same error though when running. On Jan 16, 2015 12:39 AM, "Adam Ralph" notifications@github.com wrote:

0.12 works without the scriptcs_ prefix, so if you still needed it then your roll back must have failed.

— Reply to this email directly or view it on GitHub https://github.com/scriptcs/scriptcs-samples/issues/20#issuecomment-70214430 .

adamralph commented 9 years ago

OK. We'll investigate the problem with the sample on Mono. Thanks for raising it.

I'm glad the script pack works though!