Unable to run Silverlight application from Visual Studio 2010 - asp.net-mvc

I'm in the process of setting up a new machine as a development environment and I'm having issues getting an existing code base that hosts a Silverlight application to work. The code runs fine on all other machines that my team uses.
Here is the error:
Error: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
I have had a Google around for some answers on this and I realize there is a duplicate question on StackOverflow already, but it does not provide enough information and the answers have not worked for me.
I am attempting to run the solution through Visual Studio 2010 Ultimate, using IIS Express 7.5 integration (as opposed to the Cassini web server). This approach works perfectly fine on all other machines, except for this one.
I have found that if I specify to use full IIS integration (instead of Express) and select the SilverlightTestPage.aspx as the start up page, then the application runs (although not perfectly). Also, if I publish the application and host it on IIS, it again works fine. However, when running through Cassini or IIS Express 7.5 integration, or when trying to get it to run through the Default.aspx or correct start up page it does not work.
Does anyone have any ideas what this might be? I've already checked that the MIME type in IIS is correct (not sure if I can do this in IIS Express as well?) and that the XAP files are building into the correct directory.

Check MIME types in IIS Express configuration file %userprofile%\documents\iisexpress\config\applicationhost.config and make sure that you have MIME types set correctly and restart IIS Express.

Please check the aspx file whether it has the "minRuntimeVersion" correctly for the Silverlight plug in.
<param name="minRuntimeVersion" value="4.0.50826.0"/>
also check the following link for hosting the Silverlight application .
Configuring IIS for silverlight

Related

How do you publish an ASP.net MVC application from Visual Studio 2013 to your local network?

I made a simple ASP.net MVC web application in Visual Studio 2013, and I want to deploy it so it can be accessed from the browser on other computers on my local network. I have tried right-clicking my project > Publish (not sure what settings to use, Web Deploy, Web deploy package, File system,
I published the website to my inetpub/wwwroot folder.
I managed to get IIS up an running, I've tried adding an application in the manager and editing the permissions to Everyone. I tried navigating to localhost/application_name but I was getting errors about not being configured to list the directory. I enabled directory browsing, but that just means it now shows a list of the files. How do I get it to actually run the app when I navigate to it in the browser?
Am I close?
Edit: currently trying this http://johan.driessen.se/posts/Accessing-an-IIS-Express-site-from-a-remote-computer (although this I think is a step or two ahead of where I am)
Also tried this: http://www.programmerfish.com/how-to-deploy-asp-net-web-application-on-the-network-in-windows-7/#.VGTLCvnF81L no luck so far
You can use IIS Express which comes with visual studio 2013. I've used this method to allow other members of the staff to access the website that is in my computer. Scott Hanselman has done a great post which I use every time when I want to expose a website hosted in local iis express to others in the same network.
http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
If you have any queries, let me know. Hope this helps
When I want to use IIS Express within Visual Studio for development, but allow local network users to see a version of my site, I tend to create a publish profile in VS that publishes to the local file system (e.g. C:\Publish\<yourwebsite>). Then from IIS Manager create a new website pointed to that same folder and it should be accessible to you via http://localhost and to network users via http://<your-pc-name> or http://<your-local-ip>.
You will need to add an exception to Windows Firewall to permit HTTP requests (i.e. port 80) through to your local machine, but if you have configured IIS correctly they should see the website.
It is possible to make IIS Express available to remote clients but that's not what it's designed for so really you're better off going down the IIS route since this will allow you to test the configuration as it would be on a live/production setting at the same time.
Check this, and old version of the same question. I'd bet you need to install IIS locally
Use Visual Studio web server in local network
You need to enable IIS on the host as IIS Express is not built with that in mind. Its for debugging purposes.
You've also not mentioned your binding configurations or your app pool settings.
Here is a comprehensive tutorial on how to publish your application using IIS IIS Video tutorial
You will need to ensure the binding that you specify is available across the network and that the connecting clients have permissions.
The issue was that ASP.net was not registered with IIS
Opened command prompt as administrator
Navigated to C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Ran aspnet_regiis -iru
Now web app runs in IIS http://www.asp.net/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-%28remote-agent%29

Routing problem with particular controller name using ASP.NET MVC 1 in IIS 7

I have joined a team developing an ASP.NET MVC version 1 application. I run this app on my local machine using IIS version 7.5. My operating system is Windows Server 2008 R2 Enterprise Edition. I use Visual Studio 2008 SP1 for development.
One of the controllers in this app is called ReportsController. The route table entries for this controller use 'Reports' as the controller name part. The problem I have is that, using IIS 7.5 on my local machine, I simply cannot access any of the Reports action methods. If I try to access, say, '/Reports/Index' from Chrome or Firefox, I get a 401 Unauthorized response (as seen using Fiddler) and the browser displays its username/password entry dialog.
Please note the following:
All other non-Report pages in the application work correctly.
If I add a breakpoint to Application_BeginRequest, it is not hit when requesting a Reports page.
If I change the Reports routing entries in the route table registration code so that I have to access paths like '/Reportss/Index' (note the extra 's') then these Reports pages work correctly.
I have tried deleting then recreating my Web application in IIS.
The Reports pages work fine if I run the application using the Visual Studio 2008 development server (Cassini).
There is no directory called Reports in the application directory.
The Reports pages work correctly on our UAT environment, also under IIS 7.5.
I have reviewed my IIS setting several times, including comparing them with those on UAT, and I can't see a problem.
While I can use Cassini to access the Reports pages, I would really like to understand what is causing this issue.
If you have Reporting Services installed on your machine. try to create a new web site and use it. If you have SSRS installed on your machine it uses /reports for hosting reports.
I have had problems using the directory name 'Reports' at the root of a .net 2.0 website on IIS 7.5. It generates a 503 Error, indicating that there is an error at the system level before IIS tries to serve the page. I am not sure if reporting services is installed on my server. I just changed the directory name, all links and everything worked.
I have the exact same issue in my MVC Application with reporting services installed on the same server where code was deployed. I have changed the Reporting Manager URL in "SQL Server Reporting Services Configuration" which was hostName/Reports and assigned a new name i.e. SSRSReports so the virtual directory is now hostName/SSRSReports.
Now my application as well as SSRS Reports are working as expected.

Unable to start debugging on the web server. The web server could not find the requested resource

I'm having this error trying to debug my ASP.NET MVC app. I've set the app to "Use Local IIS Web server", and selected ASP.NET as the debugger. Running the site without debugging works just fine, but when I try to debug, I got this error:
Unable to start debugging on the web server. The web server could not find the requested source.
I'm using Visual Web Developer 2008 Express Edition.
Does anyone know how to fix this error? Thank you.
For those encountering this with Visual-Studio 2012 and/or Windows 8 do the following.
You have to add .Net 3.5 (or 4.5) to your Turn Windows Features on or off window. You get to it via :
Control Panel -> Programs -> Turn Windows Features on or off
Click the Asp.Net 3.5 and the Asp.Net 4.5 check box in the IIS > WWW Service > Application Development Features folder.
Go to your web project's properties, then the "web" tab, then make sure that you're using the Visual Studio Development Server and not Local IIS or the custom webserver. I'm on VS2010 with Win7 and another developer was developing using a custom webserver URL and not the VS Dev Server
Sounds like you are trying to develop on IIS and not iis express or development server. If you are using asp.net mvc 4, make sure that the Application Pool is framework 4. If not just make sure that your app pool it matches your asp.net mvc version.
I had the same problem, and i fixed this way:
Go to IIS Manager -> Go to the site -> Error Pages -> Actions: edit feature settings.. -> Make sure you checked "detailed errors for local requests and custom error pages for remote requests".
IF you are using IIS6 and did the add mapping for .* in IIS trick to get MVC working, when you added the .* handler to iisapi.dll you forgot to uncheck the "check the file exists" check box.
Also, be sure that the URL you're configuring in Visual Studio matches your Host Headers (Edit Bindings) in IIS. This tripped me up for about an hour this morning before I realized my very stupid error.
Having maxRequestLength or maxAllowedContentLength set to a ridiculously large or small value will also trigger this error.
What i did, was just type the IP address in the web tab instead of "localhost"
This happened to me today. Turned out to be that the default website was stopped in iis. I had been working on a second website that didn't use it for a long time. Simple fix but took me a while to see it!
The root cause for this error can often be that the Windows Service W3SVC is not started. Check that this service in Windows Services console (services.msc) is started. In IIS you will now see the the Start icon is greyed out. This means that the W3SVC service is running.

ASP.NET MVC project won't start under IIS 5.1 on Windows XP SP3

I've a ASP.NET MVC 2 project that runs fine under Windows 7 and will start on Windows XP if I use the Visual Studio Development Server, however, starting under IIS generates an error:
Unable to start debugging on the web server
With the message
The specified procedure could not be found
No errors in the system event viewer.
If I start without debugging I get an "HTTP 500 Internal Server Error"
The reason I run it under IIS is the project also includes some WCF wsHttp web services that use certificates, so the VS Development Server is not adequate for hosting those.
I have already seen the links on SO that talk about adding the wildcard mapping. I've already done that, just as I've done on Windows Server 2003 where I successfully host ASP.NET MVC RC2 for quite a while.
See if this helps - its possible but not ideal:
http://blogs.microsoft.co.il/blogs/dorony/archive/2007/12/15/using-asp-net-mvc-on-iis-5.aspx
Check out this blog it might help. IIS 6 and under does not easily support MVC Routing.
http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx
The error said "procedure could not be found" so I double checked the ISAPI dll.
Turns out when I added the wildcard mapping to ISAPI, I picked aspnet_filter.dll instead of aspnet_isapi.dll. Once I switched it, the app starts up fine and serves pages fine.

Deploying MVC Application to Web Server doesn't run correctly

I have reading posts all night looking for an answer to my issue and haven't found anything that works for me yet. I am sure there is a simple way to do this but I haven't been able to discover it yet.
Details:
MVC 2 Preview
Asp.net 3.5 sp1 framework
VS 2008 C# web application
Windows Server 2008
IIS 7
I have the application running well through VS 2008 no problem. When I hit the play to run in debug mode it starts the ASP.NET Development Server the application loads fine and works as expected, great!
When I publish the application locally or to my web server both on IIS 7 the application doesn't run correctly. Some of the icons are missing and the google maps map is missing. When I view the source it appears correct at first glance, but I can see the paths to the images are looking for the MVC paths and it isn't finding them. It appears the app is running as a regular asp.net app and not an mvc app, maybe?
I also tried to just hit the full source code locally on localhost and the exact same issue is present.
So, I guess my question is how do I deploy a MVC application to run the same in IIS as it does through the development server.
PS The environments are clean and pretty much out of the box.
#user68137 is correct in saying that you need to use relative paths for the images.
I got caught out on this one too, and here's my previous SO question about it...
In short, you need to do something like this...
<img src='<%= Url.Content( "~/Content/Images/banner.jpg" ) %>' alt="Banner" />
Hope this helps!
I had the relative paths set, but what I didn't realize is when I deployed it to the server it went to wwwroot\subsite... I had the relative paths set to src="....\image.jpg" to get back to the root of the site. My error was that if the site is not in the root then the subsite drills back to the root to find the images and of course doesn't find them. Same thing was happening with the JS files. I used the Url.Content and it worked great! problem solved!
The interesting this is when running through the VS dev server with a subsite it still worked well and found the paths even though it shouldn't have. VS dev server <> IIS
Thanks for your help on this!
Simon.
Once you know the virtual path to the location you are deploying the project to, you should go into the project configuration in Visual Studio and add it to your project. This way the visual studio development server will use the same path structure as the deployment server. This will save you countless hours of work when deploying.
When you run your website through Visual Studio, every single request gets processed through the ASP.NET pipeline, including images, CSS and other resources. IIS by default only processes specific extensions (e.g., aspx) unless you tell it otherwise through configuration. Paths like '/content/images/yourimage.jpg' should work just fine...I suspect it's something amiss in your IIS configuration.
Another possibility which I've run into is any custom ISAPI filters you may have installed on the IIS server (e.g., ISAPI_rewrite). It's easy to set up rules in its configuration that lead to some very unexpected results.

Resources