Attaching ants performance profiler to asp.net-mvc site fails - c#

Currently my asp.net-mvc site makes the w3wp.exe process cpu run at 100%.
I figured red-gate's ants profiler should be able to give me some clues as about where I should be looking.
When I start a profiling session I can choose between IIS hosted- and dev server hosted asp.net web application. One of these look like the most logical option to choose from to me
ASP.NET web application (hosted in web dev server)
I pointed it to my web app's dir (where the default.aspx) is at and set the bind port to the correct port.
Pressed the Start Profiling button
ASP.NET web application (hosted in IIS)
After loading and launching the project, I filled in the complete URL to my localhost (including port) and pressed "Start profiling"
Both options fail with the following exception
Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070002.
System.IO.FileNotFoundException
at bP.a(Boolean )
at bP.a(Uri )
at bT.LaunchFrontEndProcess()
at RedGate.Profiler.Session.ProfilerSession.i()
at RedGate.Profiler.Session.ProfilerSession.j()
Any ideas?

That looks like it's ANTS trying to open Internet Explorer, but for some reason it can't. You haven't used windows 7's ability to uninstall internet explorer by any chance have you?
Keep an eye on http://www.red-gate.com/products/ants_performance_profiler/index.htm as we're hoping to switch to using your default browser for this rather than always using IE at some point soon.

Related

Accessing ASP.NET web application that only runs on a local machine

So I have zero experience with deploying software or putting something live. The situation is like this:
I have developed a dashboard web application on a laptop. This application uses a microsoft SQL database that also runs locally. When I run it, it's a localhost address. Now, I need to be able to access my web application from other PCs within my company's network. This way I can do some user testing. What are ways to do this? I searched and things confuse me to no end.
I use:
.NET Framework 4.5
Visual Studio Ultimate 2012
IIS7
Thanks
There are a few things you'll need to do to make your local application visible on the network. I'm assuming you want your app running on something like http://foobar/myapp where foobar is the name of your machine
Here is what you need to do:
Add a URL reservation so your machine will allow IIS to serve content on the url http://foobar/myapp
Create an inbound rule in Windows Firewall to allow incoming connections on port 80
You can find the exact commands you need to run on Scott Hanselman's excellent blog post. Of course, he's focusing mainly on getting SSL to work with IIS Express, but it has enough pointers to get you going, too.
look at msdn.microsoft.com
you can learn about:
Prerequisites
Creating the Web Site
Creating a Test Page and Class
Publishing the Web Site
Testing the Published Web Site
Next Steps

"Program can not display web page" error while taking snapshot HtmlCapture.Net

I have an ASP.NET web application developed in Visual Studio 2008 which uses HtmlCapture.Net (www.polestarsoft.com/products/htmlcapture-net/) to take snapshot of some pages.
For example, application has to take snap shot of this page:
http://www.yillikfabrikasi.com/KullaniciYillikSayfasiVersion2ResimlerArkaPlan.aspx?username=bolatug#gmail.com&yillikId=ab05ab4c-138b-4332-b4ca-78484bae5b3e&refresher=31b8ff91-00a0-4122-bea8-87efd879ad83
It was working fine until I moved the application from Windows Server 2003 to Windows Server 2008 (64 bit). Now all images the program takes includes the error message "This Program cannot display webpage" instead of the actual page. You can see how it should be in the link above. here is the picture the application takes
I tried to configure the app pool to DefaultAppPool with identity set to Local System account and the classic app Pool with the same identity. Both configurations fails to take the snapshot.
I have logged the URL used to take the snapshot and I can see the correct page in a browser and take a snapshot with the HtmlCapture.Net application. So I am sure the URL is correct.
What could be the reason for this problem? I think some configuration or security issue prevents the HtmlCapture.Net dll from opening the URL. But I don't have any idea how to fix it. So any opinion is appreciated.
That component seems to use the installed webbrowser (IE) via ActiveX or similar.
Windows Server 2008 has (compared to Windows Server 2003) enhanced security on several levels... including:
IE enhanced security configuration
Different security model for IIS
Different security model for Windows Services (which IIS happens to be)
etc.
Any of the above might lead to the behaviour you see... IMHO it is best to contact the vendor of the component regarding system configuration...
An alternative is to use a component wich does not suffer from the above mentioned aspects - namely does not use IE or ActiveX for that functionality... there are some components (mostly commercial) out there... IF that is an option for let me know - I can post some links...

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

Local Testing and Debugging Facebook iframe app (Windows Azure)

I wonder what the best way to test and debug facebook iframe applications locally (using the facebook c# toolkit and the azure toolkit)?
When i try to debug it's always starting the Compute Emulator on a different port.
Basically i want to have a special facebook iframe app pointing to a specific port on localhost (e.g. http://localhost:81) and after pushing the debug button that my app url (e.g. http://apps.facebook.com/myspecificappdev) is being started in my browser (with debug functionality).
I found this thread but unfortunatly this didn't help me a lot: http://azuretoolkit.codeplex.com/discussions/207487
What's the best way to debug such applications? Is their maybe a sample project which already has that part set up correctly?
Ok, here is what we do (at Thuzi). We set up an dedicated IIS web site for our code. We create a bogus domain like fbapp.mycompanysdomain.com and then we edit your machine's (or other machine's) Hosts file to point to the proper IP address. When we set up the site in IIS we use a host header which means that we don't need to worry about port numbers. When we debug we simply attach to the process.
So you point your web browser to the FB URL and it should always land on your web server (whether you are debugging locally or not). I know this sounds like a little more work, but it ends up being so much easier in the long run and better reflects what will ultimately happen. I realize if you are using any kind of storage then you will need to start that up, but it's still a lot easier this way..
If your app is simply a website, then you don't need to run the compute emulator to run it. I would setup the site so that it runs on IIS on a specific port, then debug the website project, not the cloud project.
There is a bit more to it than just that however. If you're using development storage then you'll need to start that yourself as it won't automatically be started when you debug the website. If you have a RoleEntryPoint class then you need to be aware that none of that code will be called. Also if you make use of anything in RoleEnvironment (like settings) you'll need to put a wrapper around those items so that they'll still work when not running under the emulation environment (RoleEnvironment.IsAvailable is very useful for detecting this). A setup like this is very useful during development because when you make small changes to CSS of JavaScript you don't need to restart the compute emulator to see your changes.
You're on the right track. You need to create a new facebook app and point the iframe / canvas / tab url to localhost with the specific port cassini chose for the project.
What I did to ensure the the windows azure app stays on the same port:
I placed this as a pre-build event:
"C:\Program Files\Windows Azure SDK\v1.4\bin\csrun.exe" /devfabric:shutdown
This makes it better but it's still switching port sometimes

IIS Session isolation problem

I am using ShDocVW.InternetExplorer class to spawn a new internet explorer object and to do some form filling stuffs(for some sharepoint works).It works fine in my own machine which has Windows 7 as the OS. But when I deployed the same thing in windows server 2003 machine, it does not pop up the internet explorer window. When I check the Task Manager, I could see a new iexplore process, but with Session ID = 0 (but session ID = 1 in windows 7). So, I see this is something regarding IIS Session isolation.So, is it possible to assign a ShDocVW.InternetExplorer instance to kind of a new System.Diagnostics.Process and achieve this task? Or can we start a new ShDocVW.InternetExplorer instance with session ID = 1?
thanks in advance.
I'm not very clear on what you are doing but if the app that spawns the ShDocVW.InternetExplorer process is an ASP.NET app then you won't see the window because IIS runs as a windows service and as such Windows Services use a different "desktop" than the desktop you're logged in as. So you'll never see any windows and Windows service application launches.
I think what you should do is create a GUI applications that instantiates your explorer window.
Basically the problem is that you are trying to do something through code, and since this will work on the server you will see a process getting spawned on the server... AND NOT on the client as you are assuming. It is working on your dev machine, since you would have been using FileSystem for your project and your project's pages are being served by cassini - Web Development Server which launches on your own machine.
The approach of filling out the form is wrong. You should be using POST request and read the values on the server for doing necessary processing of the data that has been posted.
Yap... I got the answer to the problem, In IIS we cannot spawn processes using Shell Execution with the default settings... If we need to do so, there are 2 workarounds that need to be set which can be found from here. And by the way, thanx very much for you guys' input and support which helps me to figure this out. cheers...

Categories

Resources