CassiniDev Web Server - c#

I've been testing out CassiniDev server for a project I'm working on currently, and I've been so impressed with this!
Big well done to the guy(s) who made this!
I do seem to have a small problem though, and wondered if anyone else has encountered it and managed to resolve it...
I'm using the the CassiniDev-lib.dll in my WinForms C# (Net3.5) project to host my web server, I start the server fine with the following command:
_server.StartServer("C:\\www\\host\\test", 32500, "/", "");
I can navigate around my ASPX web pages with no problems in the forms WebBrowser control, but if I leave the Form running for a few minutes and return to use it the server doesnt respond?
The server is still in "started" mode, but if I refresh the current page or try navigating to a different one I receive the error:
This program cannot display the webpage
If I stop the server manually, then restart, it works again for a few minutes, then repeats the same error.
IIS is not running in the background or anything, tried diferrent Ports but still seems to happen.
Does anyone have any ideas/experience with this cool little webserver?
Thanks all!

Related

C# Smart-client deployment is not working?

I haven't deployed a smart-client in a very long time, so I may be doing something wrong. My publish works well, and the app works for me (could be cached?), but my users can't run the app and instead get this error:
Can't reach this page
Make sure the web address XXXXX is correct
Also, when I browse the page from the server, IE briefly starts like the app is going to run, but then nothing ever comes up. The default document is set correctly.
The app works perfectly locally, so I am sure it is an IIS setup issue.
I am just not sure where to go with this. Can anyone offer a suggestion for troubleshooting steps?
The problem is that my organization (actually, the parent organization over my organization) had decided to block the port I was using. After I convinced them to open the port, all worked as expected.

Run c# code on client side or make a web session interactive?

I'm making an application on c# for signing PDFs. Its works perfectly on my visual studio web project, but when I publish it on my test server it throws me this Error
In this case I'm trying to execute the code that sign a pdf on the server and the error occurs specifically on the line:
System.Security.Cryptography.Pkcs.SignedCms.ComputeSignature()
It is supposed to throws a window on your desktop asking for your certificate (reading a smart Card) and then asking for your PIN just like this
Windows Security Window but I have the hunch that it's not possible because Its implies that the server have to have the possibility to interact with the client's desktop
Ok, now that I've explained all the enviroment that I'm facing, here are the solutions I've tried until now:
1) Trying to correct the Server Error above: I went in the server to IIS>application Pool>MyPage>Advanced Settings>Process Model>Load User Profile and selected True instead of False (Didn't Work)
2) Still trying to correct the Server Error I Went to Computer Management>Services and Application>Services and turned on the service "Interactive Service Detection" (Still not working and doesn't work even if I do the same on the client computer)
3)Finally, I guess that it's not possible to run the code on the server because the Error line above is a native calling of Windows Security so I thought: what if I try to run the code right from the client?. Like a c# applet equivalent or something, well... there are two ways for do that: ActiveX (old technology) and Silverlight (newer). The thing is that I just can't make a simple Silverlight program start on chrome, it does on firefox and IE but if doesn't work on chrome is a totally waste so my last option is to make it run with an ActiveX, and there is almost none useful information in the internet about that
If someone can tell me what to do, either to correct the error or to make my program run from the client side, I would be so grateful
You can't call the system's api from a Web client as this would break the sandbox. If you must use that system call, create a wrapper on the server that will handle the popup, although this would be a very "hacky" solution. You should really be asking why I am trying to use a Web client interface if I must use said native system call.

C# MVC app on Azure: Site works fine when freshly deployed but fails after being left idle

I have spent a good bit of time researching this but have not found anybody else reporting the issue that I am having.
I deploy my site and everything is good. I share the link with my QA and UI peeps and everything works for them. But if the site goes for a period of time, such as overnight, without being accessed then the web application is unable to start and reports "Method 'get_CurrentUser' in type ... does not have an implementation." Stopping and restarting the site does not resolve the issue but if I simply re-upload the main .dll file (the exact same version of the .dll) to the site then everything works fine again. For a while, at any rate.
Why would it be okay when newly published but fail after sitting for some time? Any suggestions on troubleshooting this would be greatly appreciated.
IIS has introduced Suspend action for idle timeout, when site is idle for specified duration, IIS will suspend process, god knows what happens exactly but looks like it just hibernates the process. And waking up may not work, so you can change this action to terminate for idle timeout.
Second option is to keep site awake by using pingdom or site24x7 services.
Could it help to try Azure Web App and set Always On?
http://azure.microsoft.com/updates/azure-web-sites-adds-always-on/
It looks like I found a solution.
The app start event in global.asax included "var assemblies = System.Web.Compilation.BuildManager.GetReferencedAssemblies();" in order to make sure that everything loads, but that line was -after- the call that was triggering all of the dependency registration. I cut/pasted that line so that it happens first and the site came up fine when I tried it this morning.

visual studio development server automatically redirects to default port with machine ip

This is a weird issue I have been facing for a couple of days now. When I run my ASP.Net web app from visual studio 2010, it starts the dev server and opens IE. I can see the correct URL getting formed (ex: http://localhost:53990/index.aspx).
But then it redirects to "http://my-machine-ip". I can see the dev server process (webdev) in task manager. If I browse the above URL in a separate IE instance, manually, I still get the same behavior.
This problem comes in chrome as well, but works properly in Firefox.
Since it was working in FF, I ignored it, but now an increasing number of my colleagues have started facing the exact same issue. Tried searching for a solution on Google and stackoverflow, but couldn't find any.
Has anyone else faced a similar issue? Would be great if I can get any help/pointers with this issue. Please let me know if you need more details.
PS: I am coding in c#, not sure if it matters but thought I should specify it.
I have faced this issue and resolved by following steps:->
Open IE
Go to Internet Option ->Connections
Click on Lan Settings
Uncheck Automatic detect settings check box.
Clear all browser cache/history
Try and browse the site now. You should be able to view your site
Since Chrome uses IE settings, this solution should work for Chrome too.

run .msi setup file after accessing web site from server to client

I have created a web application in ASP.NET, with C#. I am getting the following message in my browser window when accessing the application:
---------------------------
Windows Internet Explorer
---------------------------
Stop running this script?
A script on this page is causing Internet Explorer to run slowly.
If it continues to run, your computer might become unresponsive.
I researched into the problem and found the following link, which is proposed as a solution to this problem:
http://support.microsoft.com/kb/175500
I want to execute this setup when a client accesses the web site for the first time. How can I run this setup on the client side?
It is not possible to fully automatically run some program from a website as #cHao said, this is what all browsers prevent.
But you may look at ClickOnce deployment, it allows for very fast and easy installation of your program literally in one click.
http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.80).aspx

Categories

Resources