Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I created a http server using C# and I took the idea from here
It works with html pages. I tried to add aspx mime-type like this "text/aspx"
but it doesn't work, it's still opened like a text file!
Any ideas?
I assume that you have only implemented static resource handling for your web server. However, for ASP(X) (or any other dynamic content) to work as expected, you need a complex pipeline which loads the file, compiles it, runs the code in the right context, and returns the result (and that is a very simplified explanation).
In general, it's no a wise idea to implement your own server stack. You'll very likely end up with a vulnerable and badly performing piece of software. Just use an existing web server (or maybe even just Cassini if you really want to see the internals working).
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
How i can add code editor C#,which will compile the code in live
I tried something with Ace, but nothing so far
Thank you.
If I understand correctly, you want to propose an input to user. They had C# code (no matter what) and your server executes it.
If yes, take a look at that.
It creates a project and build it in memory before executing it.
Be careful cause if you execute the code no matter what it will be a security breach into your server. For example, someone could execute a code which will download a file onto your server and open a backdoor to it.
Check this site:
https://dotnet.microsoft.com/platform/try-dotnet
This is embeddable .Net compiler which you could use without any preparations and setups
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
There is swagger and there is nswag.
NSwag does some client generation.
Is it possible to generate client and display it as a link on Swagger UI for the consumers to download and use it?
Almost certainly not out the box. But then... you don't necessarily know what technology your client will choose. NSwag will generate a number of different types of clients in just a few minutes with little more effort than pointing it at the JSON Swagger definition (which Swagger/Swashbuckle automatically produces for your API), and is free to download; why not just let them do it?
You could speculatively generate a C# client for them and host it on your API server and serve it as say a zip file, but I don't really see the point, plus you'd have to make various customisation decisions for them, that they might prefer to make for themselves (namespace, HttpClient injection, partial class usage, etc).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm trying to make a call for a php code on server from react native, and return a value and display it.
The idea that I have an image I want to process it on server save it then return results and the resulted image(I already have a php code on server that run a C# code and give back the results) then showing them on the mobile app . any idea?
Do you have a REST API to provide this image?
If you do I use Axios to make http requests.
If you don't, i think fetch has the ability to communicate with a server via TCP.
I suggest you create an API endpoint to provide your image.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to understand on a conceptual level how information travels from the Database(Microsoft SQL) to the Frontend with C# & ASP.Net . I have not had much luck finding examples or diagrams which address this concept in a clear way. One example could be sending the string "Hello I am a string stored in the database & now I appear on this front end web page", It does not have to be specific to these languages, although if it is that would be great. Ultimately, I want to understand what are the components involved and how do they communicate information back and forth.Any articles,videos or diagrams that you feel of importance are also highly valued, thank you for your time.
Here's a diagram. I hope it helps.
An overview could be like:
User sends request to web server through client i.e. browser
Web server queries database
Get query results
Generates HTML (if results found)
Send back to the browser
Browser displays on the screen
Every step has details but it is an overview, hope makes some sense.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
We want to implement a application help and documentation system. It should be based on HTML, because there are a lot of existing files and it gives us the most flexibility. Currently we use CHM files. We want to enable internal people (not developers) to edit the contents.
We thought of a stand-alone application that supports TOC, indexing (tags), search, etc. We also thought of using a local web server.
Until now our application uses pure C#, it would be good to keep this.
We are totally clean of web/asp knowledge, so the question is:
Where is a good place to start?
You can use documentation apps like SandCastle
Which use your XML documentation in your code to generate a help file.
Finally we ended up implementing a local HTTP server:
Internal people creates HTML content within our internal network
Our own build-tool creates the TOC and a search index and packs all content to a zipped file
The zipped file is packed into the application installation
When the end-user call help from within our application, the local http server is started
The HTTP server uses the HttpListener class
With this, it is possible to have some HTTP queries for special tasks like starting tools of our application by clicking a link without interception of the browser