Git Product home page Git Product logo

scriptcs-webapi's Issues

Cannot resolve dependency on Owin

  > scriptcs -install ScriptCs.WebApi2                                                       
Installing packages...                                                                       
ERROR: Error installing package. [InvalidOperationException] Unable to resolve dependency 'Mi
crosoft.AspNet.WebApi.Owin (? 5.2.0 && < 5.3.0)'.                                            
ERROR: Package installation failed. [AggregateException] One or more errors occurred.      

NuGet package out of date

Just a heads up.

The NuGet package on NuGet (https://www.nuget.org/packages/ScriptCs.WebApi/) is version 0.1.0. The code here is at version 0.5.0.

I am getting the following error when using the NuGet package (0.1.0) and executing scriptcs start.csx:

Message: No HTTP resource was found that matches the request URI 'http://localhost:8080/api/Test'.
MessageDetail: No type was found that matches the controller named 'api'.

I don't get this error when using the code here (0.5.0) directly.

Fix for scriptcs 0.15.0

Currently the script pack insists an a Common.Logging.ILog being injected but in scriptcs 0.15 we do not, and cannot, register that type in the container, since then the container will not be able to pick a constructor for various types which have both a Common.Logging.ILog overload and a ScriptCs.Contracts.ILogProvider overload.

After the scriptcs 0.15.0 release, the script pack should be upgraded to the 0.15.0 binaries and insist on a ScriptCs.Contracts.ILogProvider being injected instead.

Getting started with Web API using the pack does not work, part 2

The TestController-example on the home page does work. When you call http://localhost:8080/api/test you get an error:

An error has occurred.Type 'System.Dynamic.ExpandoObject' with data contract name 'ArrayOfKeyValueOfstringanyType:http://schemas.microsoft.com/2003/10/Serialization/Arrays' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.System.Runtime.Serialization.SerializationException at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer, Object graph)
at System.Net.Http.Formatting.XmlMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content)
at System.Net.Http.Formatting.XmlMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Owin.HttpMessageHandlerAdapter.<BufferResponseContentAsync>d__13.MoveNext()


install ScriptCs.WebApi2

scriptcs -install ScriptCs.WebApi2
Installing packages...
Installed: ScriptCs.WebApi2
Package installation succeeded.
Saving packages in scriptcs_packages.config...
Creating scriptcs_packages.config...
Added Microsoft.AspNet.WebApi.Client (v5.2.0, .NET 4.5) to scriptcs_packages.config
Added Microsoft.AspNet.WebApi.Core (v5.2.0, .NET 4.5) to scriptcs_packages.config
Added Microsoft.AspNet.WebApi.Owin (v5.2.0, .NET 4.5) to scriptcs_packages.config
Added Microsoft.AspNet.WebApi.OwinSelfHost (v5.2.0) to scriptcs_packages.config
Added Microsoft.Bcl (v1.1.9, .NET 4.5) to scriptcs_packages.config
Added Microsoft.Bcl.Build (v1.0.14, .NET 4.0) to scriptcs_packages.config
Added Microsoft.Net.Http (v2.2.22, .NET 4.5) to scriptcs_packages.config
Added Microsoft.Owin (v2.0.2, .NET 4.5) to scriptcs_packages.config
Added Microsoft.Owin.Host.HttpListener (v2.0.2, .NET 4.5) to scriptcs_packages.config
Added Microsoft.Owin.Hosting (v2.0.2, .NET 4.5) to scriptcs_packages.config
Added Newtonsoft.Json (v6.0.2, .NET 4.5) to scriptcs_packages.config
Added Owin (v1.0, .NET 4.0) to scriptcs_packages.config
Added ScriptCs.Contracts (v0.10.0, .NET 4.5) to scriptcs_packages.config
Added ScriptCs.WebApi2 (v1.0.0, .NET 4.5) to scriptcs_packages.config
Successfully updated scriptcs_packages.config.


run script

scriptcs test1.cs -modules mono

Error <The name 'Require' does not exist> when trying the sample for webapi server

Following the sample, I am running into the following error when running the .csx file for the webapi server:

C:\dev\temp\scriptcs2> scriptcs server.csx
ERROR: Roslyn.Compilers.CompilationErrorException: C:\dev\temp\scriptcs2\server.csx(7,14): error CS7012: The name 'Require' does not exist in the current context (are you missing a reference to assembly 'ScriptCs.Contracts, Version=0.7.0.0, Culture=neutral, PublicKeyToken=null'?)
at Roslyn.Scripting.CommonScriptEngine.CompilationError(DiagnosticBag localDiagnostics, DiagnosticBag diagnostics)
at Roslyn.Scripting.CommonScriptEngine.Compile(String code, String path, DiagnosticBag diagnostics, Session session, Type delegateType, Type returnType, CancellationToken cancellationToken, Boolean isInteractive, Boolean isExecute, CommonCompilation& compilation, Delegate& factory)
at Roslyn.Scripting.CommonScriptEngine.CompileSubmission[T](String code, Session session, String path, Boolean isInteractive)
at ScriptCs.Engine.Roslyn.RoslynScriptEngine.Execute(String code, Session session)

Cheers!

fix CI build

It's been broken for aaaaaaaaaaaaaages....

And makes our scriptcs root node red :rage1:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.