Questions tagged [nancy]
Nancy is a lightweight web framework for the .Net platform, inspired by Sinatra. Nancy aims to deliver a low ceremony approach to building light, fast web applications.
1,108
questions
0
votes
0
answers
12
views
How to use global variable in razor file in nancyfx framework
How can I use a global defined variable in NancyFX Framework to be used in a HTML (Razor) Template file?
Is it the right place to add those variables in app.config?
How do I access it in the HTML ...
0
votes
1
answer
88
views
How to start Nancy web server in c# (wpf)
I'm trying to start a simple Nancy web server (In a WPF project as I need to have some windows as well...) using this code :
public class ProfilePage : NancyModule
{
public ProfilePage()
{
...
0
votes
0
answers
15
views
Why are my Nancyfx 2.0 Posts passing empty dictionaries?
I have a fairly simple project I've started with Nancyfx. I know it's no longer supported, but it seems as though it should satisfy my minimal needs in its current form.
I haven't tried using Nancy ...
2
votes
0
answers
115
views
ASP.Net (not Core) Web API - Change JSON answer formatted in Camel case to Pascal case
I have been introduced to an already existing C# ASP.Net Web API project a week ago. It returns all the data in JSON and Pascal Case, and this data is used by websites using React.Js which are case ...
0
votes
1
answer
111
views
How to replace NancyFx Basic Authentication with our Custom Authentication?
We are forced to use NancyFX, either 1.4.4 or 2.0.0. We are using .NET Framework 4.7.2 and Visual Studio 2019. The solution is self-hosted in OWIN and runs on Windows Server 2012 R2 or 2016.
The ...
1
vote
1
answer
83
views
JProperty does not generate double quotes for value
I'm trying to create a JSON response that is not based on any class or object. It is very dynamic in nature. Hence I've started to use JObject from Newtonsoft.Json.Linq. While it generates the ...
0
votes
1
answer
72
views
How to run NancyFx and Mvc5 with razor in one application?
I have working application based on NancyFx (1.4.3) and Owin. Now I want to remove NancyFx and replace (incrementally) with Mvc5. Those little steps allows me to port the whole project to the asp.net ...
2
votes
1
answer
456
views
'Could not load assembly', but the assembly is already loaded
I am working on a simple WPF app which makes use of two external DLLs, Nancy.dll and Nancy.Hosting.Self.dll to send some data over http. I'd like to keep the .exe file standalone so I'm trying to ...
0
votes
1
answer
52
views
Using a reference which references a 3rd-party 32-bit C dll on a Nancy Projects causes System.BadImageFormatException
I have a Nancy project on .NET 4.8 in C# which was giving the error below on this line:
host = new NancyHost(new HttpBootstrapper(), hostConfigs, uri);
System.BadImageFormatException: Could not load ...
0
votes
1
answer
38
views
HttpClient not sending post data to NancyFX endpoint
I am doing some integration testing of my web API that uses NancyFX end points. I have the xUnit test create a test server for the integration test
private readonly TestServer _server;
private ...
1
vote
1
answer
48
views
Topshelf: Issues using NancyFX with Topshelf 4.2.1
I am trying to develop a data access service using Visual Studio 2019, .Net Core 3.0. I am using NancyFX to handle http requests. this is working just fine as a console application. When I build and ...
0
votes
1
answer
90
views
Nancy FX - Post request containing picture - C#
I am looking for some help using Nancy in C#. First, my goal. My goal is to recover an image contained in a post request from an html form. I thought it would be simple but it's a bit more difficult ...
1
vote
1
answer
105
views
Nancy Self-Host 404 Errors
I'm trying to build a simple Nancy self host. I got it working if I send in the proper path, but if I send empty path after port #, I get is error 404. If I send an invalid path I get error 500. What ...
0
votes
2
answers
7k
views
Error "ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY" in Google Chrome while accessing locally hosted SPA
I've a locally hosted SPA (Kestral/.Net core). It is using a self signed certificate for HTTPS communication (generated through Server Certificates in windows 10).
It works well with IE11, however ...
1
vote
1
answer
71
views
F# and mailbox processor does not execute
I am using F# mailbox processor to synchronize data exchange so there are some operation and flags (send and finalized) are set to true, but sometimes I need to reset then so I am using api to do this,...
0
votes
1
answer
1k
views
.NET/C# REST Api Messages to Queue [closed]
I am new to .NET/C# and I am wondering how oyu could achieve the following scenario:
I need a REST Api with has one endpoint, which accepts a message(string).
That message should be stored in a Queue ...
0
votes
1
answer
2k
views
Dynamic base-href for Angular
I have a request from a customer to run an Angular App with a subpath like "www.domain.com:9083/portal". Problem is that the angular app does not know about the subpath when it is loaded. The only ...
1
vote
0
answers
94
views
How do I force Nancy to use application/json Response for Integers? Nancy assumes them to be StatusCode
I found this thread Override the default Content-Type for responses in NancyFx and would've commented there, but haven't met the 50 rep reqirement yet as this is my first account after years of ...
1
vote
1
answer
2k
views
How to install the package of image in octave gnu?
I have tried installing a package in Octave using this command:
pkg install image-2.12.0.tar
But I received the following error:
error: pkg: failed to read package 'image-2.12.0.tar': Couldn't
...
3
votes
2
answers
170
views
How can I do something before processing a request in Nancy 2.x?
I want to do some things in every request, no matter the Module or Route. How can I accomplish this in Nancy 2.x?
If found How to Intercept all Nancy requests and How do I capture all requests ...
1
vote
1
answer
172
views
How to skip Basic Authentication on certain conditions in self-hosted server?
I have an ASP.NET web application, let's call it Web App A, that is self-hosted using OWIN and NancyFX.
Web App A uses Basic Authentication, which is set up in CustomBootstrapper.cs like this:
...
0
votes
1
answer
51
views
Cannot access NancyHost server from another computer/mobile in same network
This is my Code:
static void Main(string[] args)
{
string url = "http://localhost:3000";
HostConfiguration hostConfigs = new HostConfiguration()
{
...
0
votes
1
answer
29
views
For AspNetCore, where can I get the extension which contains UseOwn?
I am trying trying to get a self-hosted Nancy application running on .Net Core.
This article shows how to get Nancy running on .Net Core:
https://www.hanselman.com/blog/...
1
vote
0
answers
57
views
How best to Convert Nancy.HttpStatusCode to System.Net.Http.HeepStatusCode?
In our app we use Nancy, but also use HttpClient to do some work. So we need to sometimes convert between the two types of status code.
Here is our solution:
var code = ((int)response.StatusCode)....
0
votes
0
answers
96
views
Nancy and razor, "Cannot find the type name or namespace .."
Since 3 days im trying to repair legacy project in m job (i never done single application in this technologies, sorry for the mistakes made bellow)
After changing Enums place (separate project) we ...
1
vote
0
answers
700
views
SignalR .net core client in .NET framework 4 apllication
I have 2 applications:
NetCore 2.2 web-application
.Net Framework 4 web-application (owin, nancy-framework). For some reasons I cant upgrade target net framework version in this
application.
There ...
0
votes
0
answers
243
views
CSRF Token is obtainable from a cookie when running locally, but is not found when the backend is deployed as an Azure App Service
I'm having an issue with retrieving the CSRF token from the cookie when my frontend connects to my backend. My backend is C# with an ASP.NET Core 2.1 Web Service app utilizing Nancy Modules. My ...
0
votes
2
answers
113
views
WebClient taking 43 seconds to download this json string https://jsonplaceholder.typicode.com/posts
12 hours ago (around dinner time here in Texas), it was working just fine at a moment when I hope the latency to be very high because of the high traffic.
Any idea why this could be happening and how ...
1
vote
0
answers
19
views
Build URI for named Nancy routes
I am new to Nancy, and trying to build a URI to a named route. It seems the Nancy.Linker nuget package is what I need for this but when I add it to my project, VS gives a warning that it cannot be ...
1
vote
1
answer
451
views
JsonConverter based on custom attribute
I am trying to convert a particular IDictionary field of a particular class differently. I was thinking of doing this based on an attribute, but it looks like it wont work.
Is it possible to somehow ...
0
votes
0
answers
157
views
How to wait and get return value from ViewModel using Caliburn Micro ActivateItem
I'm developing a desktop application that can communicate with a browser. What I want is to send a parameter from the browser to the desktop app to do some process and then get the return value as ...
0
votes
1
answer
953
views
How do I get data from a POST request on Nancy 2.0?
I need to implement a POST request handler using NancyFX 2.0. As opposed to a GET request, I don't understand how to handle the POST on Nancy 2.0, as there isn't any data on the url nor in the ...
0
votes
0
answers
41
views
Finding the API using reflection from the server & using it like NancyFx
From what I understand NancyFX uses Reflection to find classes that extend NancyModule, and then it can use those classes and make the http calls through them.
I've managed to get the class I'm ...
1
vote
1
answer
268
views
Nancy Modules are globally discovered, how to implement the same idea with .net?
I have a web api project, and I have a HttpSelfHost server.
I know that when using NancyFX you can use Nancy.Self.Host to host a server and then make calls to the API which extends NancyModule, I got ...
1
vote
0
answers
83
views
No Overload for method matches delegate with Nancyfx
I have a function that's called from a Nancy route, which works fine with a route parameter and a cancel token parameter, but I would like to add a third parameter but I get an error (Error CS0123 ...
0
votes
1
answer
37
views
NancyFx - Find the server over a local network
Scenario: I have a small POS system running in a brick-and-mortar store. The software is running in Windows machines with SQL Server 2008 - 2012 (it varies). There are Android tablets that need to ...
0
votes
2
answers
65
views
Simple Nancy Routes return 404
I'm brand new to Nancy and going through some simple tutorials.
I'm trying to make a route in Nancy just to print out hello but returns 404 resource may have been removed...
Here is what my code ...
1
vote
1
answer
351
views
Nancy.Json.JsonSettings in Nancy v2
I'm upgrading my project from Nancy 1.4.5 -> 2.0
And I have errors:
public class AppBootstrapper : AutofacNancyBootstrapper
{
private readonly ILifetimeScope _scope;
public AppBootstrapper(...
1
vote
1
answer
124
views
How to bind form to Nancy
I’ve written a code snippet creates HTML form via C#. But I want the form’s fields to be bound class’s field after the form is submitted. How can I do that and check the result(if the class’s fields ...
0
votes
1
answer
219
views
RestRequestAsyncHandle.Abort() won't trigger CancellationToken.IsCancellationRequested
I have two C# app running simultaneously. One is a C# console app that sends REST calls to the other and the other is running a Nancy self hosted rest server.
Here's a really basic view of some of ...
1
vote
1
answer
154
views
Executing a console app through AWS CodeDeploy doesn't work, but manually running the batchfile does?
I have a Nancyfx console application, which I'm trying to deploy to an AWS EC2 Windows instance using AWS CodeDeploy. All steps show a successful run in CodeDeploy's Deployment dashboard, though the ...
2
votes
1
answer
221
views
How to keep member variables or properties on nancy module's side?
I would like to know if it's possible to keep member variables or public properties under a NancyModule.
Here's a simple example of what I think should work but doesn't.
public class MyModule : ...
0
votes
1
answer
41
views
Unable to access to a nancy webservice form external connections
I have a nancy (2.0.0-clinteastwood) web service and I am unable to connect from outside.
I've tried the following solutions without success:
https://github.com/NancyFx/Nancy/issues/2416
Remote ...
1
vote
1
answer
83
views
Creating dynamic content in nancy self hosting
I have a standard .NET framework application and I'm trying to make a web front end for it. I'm trying to have nancy render custom content, where i can pass in a model and then i can reference that in ...
5
votes
1
answer
94
views
How to separate interface from implementation in nancy2.0?
As you can see at this link, it was possible to separate the rooting and the implementation of the old nancy1.X modules. Now that the way of defining these routes have changed, I would like to know ...
0
votes
1
answer
188
views
Porting JWT stateless authentication from Nancy 1.4.5 to 2.0.0
I implemented JWT stateless authentication in Nancy 1.4.5 and it used to work fine.
Porting my project to Nancy 2.0.0, the authentication mechanism doesn't work any more.
In the bootstrapper's ...
1
vote
1
answer
429
views
Nancy request tracing does not show anything
After many trials, I can't seem to get Nancy's Diagnostic Tracing to show anything beyond a set of empty white boxes. It appears one box per browser session. Yet the boxes never include any ...
1
vote
0
answers
38
views
Is there any way to detect if a nullable parameter is present in a Nancy request body
Background
I have a web server using Nancy 1.4.3. Nancy model binding is used to deserialize data from an HTTP request with a json body. See example below.
Example
Endpoint in server:
private ...
1
vote
0
answers
254
views
How do you use Lamar as the IOC in NancyFx inside an ASP.NET Core web-application?
I'm building an ASP.NET Core REST Service. So far, I have a (working) ASP.NET Core (2.2) web-application that I have altered to use a Lamar IOC. It works beautifully.
I now want to add Nancy(fx) to ...
1
vote
1
answer
33
views
How can I test this module using Nancy.testing
I'm struggling with this...
Well, I have a .Net Core Console Application project using Nancy, this is what I got
using Nancy;
public class HomeModule : NancyModule
{
public ...