I inherited a Silverlight 5.1 asp.net application which has been running successfully on a Windows 2008 R2 server running IIS 7 for many years. I've been tasked with moving this application to a Windows Server 2016 Standard machine with IIS 10.
I installed Silverlight 5.1 (client) and the Silverlight 5.0 sdk on the Windows 2016 machine but otherwise made no changes. The machine has Framework 4.7.2. Several other asp.net applications are hosted on this server, but this is the first Silverlight application.
I tried simply copying the old application to the new server, and also rebuilding and publishing the application from the source code to the new server. I've tried running under both http and https. In all cases I get the error as described below.
When I navigate to the application using IE 11 with the Silverlight plugin installed I get a popup, "Load operation failed for query 'GetUser'. [HttpWebRequest_WebException_remoteServer] Arguments: NotFound..." and etc.
Nothing is logged that can be seen in the Windows event viewer.
Using Fiddler I can see that the browser is making this call first and getting a 404 Not Found error:
GET http://xxx.xxx.xxx.xxx/ClientBin/PMSys-Client-Web-AuthenticationService.svc/binary/GetUser HTTP/1.1
Referer: http://xxx.xxx.xxx.xxx/ClientBin/PMSys.Client.xap
Looking in the source code I see there is a class named "AuthenticationService", which derives from System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase, which in turn has a GetUser method. I can also see the file PMSys.Client.xap in my "ClientBin" folder. I assume some Silverlight magic inside PMSys.Client.xap creates the path http://xxx.xxx.xxx.xxx/ClientBin/PMSys-Client-Web-AuthenticationService.svc/binary/GetUser.
Using the same instance of IE 11 and Fiddler, but calling the old, successful machine, I notice that it gets Silverlight.js first, and then makes the same call to ...binary/GetUser. On the new, failing machine there is no call to get Silverlight.js. I assume this is a clue.
I can run this application in debug mode in Visual Studio 2017 on my local machine. The App.xaml.cs file contains a method "Application_Startup". This method calls WebContext.Current.Authentication.LoadUser(), which in turn calls this bit of code:
public EntityQuery<User> GetUserQuery()
{
this.ValidateMethod("GetUserQuery", null);
return base.CreateQuery<User>("GetUser", null, false, false);
}
This works on my local machine. I assume this is the "GetUser" call that is failing when I visit the application on my 2016 server; my understanding of Silverlight is that this "GetUser" call is made by the Silverlight runtime in the browser to the server.
My question is, what am I missing in my setup that is causing the 404 error? Why does the old, successful application load Silverlight.js, but the new, failing application does not?
This seems to be a server-side problem. If I paste the path http://xxx.xxx.xxx.xxx/ClientBin/PMSys-Client-Web-AuthenticationService.svc/binary/GetUser into a browser address bar I get a 404 error when I hit the new, failing site. For some reason IIS is simply not serving up Silverlight stuff. But if I pass that same path to my old, working application I get the usual browser prompt, "what do you want to use to open this file," and the result of the call streams down to me.
On both the new (failing) and old (working) sites, if I paste the path of the referer, http://xxx.xxx.xxx.xxx/ClientBin/PMSys.Client.xap, into the browser address bar I get the usual prompt, "what do you want to use to open this file."
I've checked every IIS setting comparing the old site to the new site and they are in agreement, including "Full Trust" and the existence of the .xap, .xbap and .xaml mime types.
Does something else need to be installed on my server in addition to Silverlight 5.1 and the 5.0 SDK?
I've seen several posts about installing RIA Services, but this appears to be a Silverlight 4 issue. RIA services are not installed on the old, Windows 2008 machine and the application is running successfully there. From what I've intuited RIA services need to be installed on the development machine in order to reference the "System.ServiceModel.DomainServices" libraries, but these become part of the deployment in Silverlight 5, so there is no need to install RIA services on the web server. I have confirmed that these libraries are in the deployment.
The answer is to enable HTTP Activation for the WCF Services under the Add Roles and Features Wizard, see this SO answer
Related
I have created a web service in Visual Studio 2015 (web api) that listens out for requests via a barcode scanner. The barcode scanner links to a database that provides information such as stock quantities etc, but this is just for background information. The web service is currently installed on my local machine and works perfectly, returning the correct values and posts data to a database.
I attempted to install the web service onto a server, copying over similar settings in IIS (only have basic knowledge using this), such as the bindings and ensuring the permissions were set up correctly. However when running the web service I recieved a "404 not found error and 401 unauthorized". After that, I installed Visual Studio 2015 onto the server to ensure it wasn't a build or publish error...same problem.
Below are some of the 'fixes' I have tried to help narrow down the potential problem.
Ensured the correct version of .Net, 4.0, is installed on the server.
IIS Manager - Authentication: Annoymous Authentication set to enabled.
IIS Manager - Directly browsing: set to enabled.
Set the correct permissions using 'Edit Permissions', granted full control to 'Everyone'
This is my first time creating a web service so up until now I have been using tutorials and making it up as I go along. I think it could be to do with the application pools set up? But because the solution works on my local machine and not the server has me extremely confused. Thanks in advance.
ok, I'm stumped.. yes, I've googled already and this time, it seems it is the first time that google failed me.
I have an ASP .Net Web Application project (acquired from a predecessor who loves brute algorithms and redundancies in his codes) and was trying to open it in a VS .NET 2003 where it was developed (well, actually not on the same machine where it was developed.) The project is a part of a larger solution composed of other VB projects. When I first opened the inherited solution some era ago, I found that an error prevented me from opening the said web project... I just ignore it then because the project wasn't that important before. Now that the project needs to be maintained, I think it's time for me to get my hands dirty with it.
This is my first time opening a web application project so I expected that there will be something wrong:
Visual Studio .NET has detected that the specified Web server is not running ASP.NET 1.1. You will be unable to run ASP.NET Web applications or services.
Right. With the use of a trusty Google, I have tried my efforts on the following (but as I have said, this time, she failed me):
Uninstall .NET framework 1.1
Reinstall .Net framework 1.1
Followed KB 306005 which says about: aspnet_regiis.exe -i
Tried the switches -u, -ua, -c and -enable for aspnet_regiis.exe
Restarted IIS
Deleted the folder for framework 1.0
rebooting and/or retrying between the items above, but I still get the same error.
There's another thing I tried, changing the path of the project in the .sln file using notepad. I changed the word "localhost" to my IP address but it produced another error saying that it can't open the project and that the web does not exist.. it asked me to try another file share path. No joy there.
I noticed that by accessing the address http://192.168.2.138/MyWebProject/main.aspx in a browser, the web page looks ok (that's my IP, btw). But the http://localhost/MyWebProject/main.aspx doesn't work and gives the message: No web site is configured at this address.
I'm using XPProSP3 with updates of Oct 2010; I have .Net Framework 2.0 SP2, 3.0 SP2, 3.5 SP1 installed together with 1.1; Latest SP for 1.1 is KB979906.
I think that I'm just missing something that needs to do before making a ASP .Net web project.. :D
I like to open the project in my VS but I'm stumped. How can I open it?
I knew I am missing something above. I was able to pass through the error today by doing the following:
Uninstalled IIS 5.1
Reboot
Reinstalled IIS 5.1
Do aspnet_regiis -i of the installed version 1.1.4322
Reboot
Tried making a new ASP.NET web app and I was able to make one.
Tried opening the file in my post above and it gave a new error:
Unable to get the project file from the web server.
Well, that's a new error for me, another story and I think there's no point of continuing this thread because the title says so. I have to move on and continue to discover how to open this file. ;)
Good day.
Change the webside address to nothing or add localhost to it (in site properties in IIS). Alternatively in project properties switch to builtin asp.net webserver.
If you can visit the site on one URL, but not another (and both point to the same computer) then most likely it is a problem with the web server configuration. Both hostnames are not bound to that solution/folder. It CAN be a firewall issue. Try temporarily disabling the local firewall.
The access logs from IIS and the Event Log are valuable resources in troubleshooting such issues.
I am developing a remote control application where a client (aspx page in a browser) can request a server to "launch a notepad" (for testing purpose, for real life, turning off a light bulb, etc). So I created a dll with a simple function for launching the notepad (on the server side) and dropped this dll in the root bin folder.
It worked fine when the aspx page is running under ASP.NET development server (launched from Visual Studio). But when I tested the same aspx page under a FireFox browser, it did not work (launch the notepad) even though it did call for the same function (I stepped through in debugger).
Is this a permission issue? How do I set this up in IIS manager, or even better in web.config?
Please help.
Yes, it sounds like a permission issue.
The application pool in IIS 7 that your site is running under is probably using the default identity, which is the most restrictive. You can change the identity in IIS Manager by right-clicking on the app pool (probably called DefaultAppPool) and selecting Advanced Settings. From there change the Identity value to Local Service or Network Service. If neither of those work, making it Local System should allow your page to work.
I assume the Visual Studio integrated web server runs under the context of the account you are logged in with on the machine, which likely has a lot more rights.
When you say:
it did not work (launch the notepad)
Did you mean it through an exception or you didn't see a notepad window open. If it was a permissions issue I would expect you that you would get an exception. Chris is right on when he says:
The application pool in IIS 7 that
your site is running under is probably
using the default identity, which is
the most restrictive.
and
I assume the Visual Studio integrated
web server runs under the context of
the account you are logged in with on
the machine, which likely has a lot
more rights.
and if this is a permissions issue he is right on. However, the user your running under (when not debugging in Visual Studio) most likely cannot access the desktop of the logged in user. Maybe you should try your test with an app that doesn't need to interact with the desktop.
I'm trying to run a test version of a web using the File System (i.e. the "Cassini" web server built-in to Visual Studio 2005) rather than (IIS 5.1 on my Win XP dev PC). This web is a hodge-podge of classic ASP files written years ago and some new development in ASP.NET (VB.NET).
How can I get past this error message as it tries to go to /TestWeb/default.asp? -
Server Error in '/TestWeb' Application.
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.asp' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /TestWeb/default.asp
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
Things I have checked and previously encountered trying to get this mess working:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config
(has nothing for *.asp nor
HttpForbiddenHandler so nothing to
comment out).
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
(has nothing for *.asp)
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config
(had a HTTPForbiddenHandler for
*.asp but I commented it out as per other postings advice; seemed to
have no effect for me though).
To get past an earlier error
("Request for the permission of type
'System.Web.AspNetHostingPermission'
failed"), I had to go to
"Administrative Tools > MS .Net
Framework 2.0 Configuration > My
Computer> Runtime Security Policy >
change Local Intranet to Full Trust.
To get past an earlier error ("the
network bios command limit has been
reached") I had to "enable a hot
fix" by adding the following DWORD
value at the following registry key:
HKLM\Software\Microsoft\ASP.NET\FCNMode
and set the value to 1 (per MS KB
Article 911272).
This whole web has been placed on a file server in our LAN and from my desktop VStudio2005 views it via the mapped drive letter (e.g. V:\SVNwork\myFolder\TestWeb)
Visual Studio 2005 models this as a "web site" (not a "web application project").
The remainder of this post describes some background about why I am trying this:
We tend to recreate the web site on our dev PC's which run IIS 5.1 on Win XP. Movement of new stuff into production can be awkward using WinDiff and copying files as needed.
I'm trying to implement source control over this work. I've had a heck of a time trying to configure Visual SourceSafe 2005 and local IIS to work together smoothly (interestingly, I had pretty good luck putting "web application projects" under VSS2005 so I think it's related to the awkwardness of the ASP.NET 2.0 "site" model and VSS).
Anyway, I've moved a development version of this classic ASP and ASP.NET to a common file server in our LAN. Before placing this under Subversion control as a working copy of it's equivalent imported into a repository, I just want to make sure it can work with the Cassini web server. That's where I am stuck. The ultimate goal is have this under SVN and view differences with TortoiseSVN.
Thanks for reading this far...hopefully someone can get me past this error and then I can move forward with the SVN and TortoiseSVN work.
Cassini doesn't, as far as I can tell, support classic ASP. An alternative would be to run a local install of Apache (since you can't/won't use IIS) which will host ASP, but is probably asking for trouble.
See also: http://blogs.msdn.com/mikhailarkhipov/archive/2005/06/24/432308.aspx
You could also run local IIS, which will, of course, host both ASP.NET and classic ASP. Visual Studio can easily be configured to debug with a local IIS install.
Points for moving to subversion: we use the Microsoft stack (Visual Studio, ASP.NET, SQL Server) with subversion and it works very well.
Subversion comment
GRRR.. bosses are fun. The svn model is known as copy/modify/merge. The repository lives in a central location - probably your file server. Using the svn client - or a Visual Studio plugin like the excellent AnkhSVN - each developer gets a LOCAL working copy,makes their changes and performs a "commit" when they're done working on a file.
SVN takes care of making sure that developers don't overwrite each others changes, provides a facility for merging changes when someone has modified a file between when you got your last copy and when you commit your changes, etc.
The whole point of a working copy is that it isolates developers from each other. The merge/commit step takes care of intergrating everyones changes. Having a central working copy that everyone works from defeats the purpose.
This is a very different approach than that used by Visual SourceSafe, which is basically a file locking mechanism. The fact that SVN is a real client-server application (where VSS is simply a disk-based "database" with no server app to administer it) provides all sorts of capabilities. We check out, modify, commit, then publish from svn to a dev server.
Also, if I remember correctly, Cassini won't server apps from a mapped drive.
We're seeing an odd pattern in our QA Lab. We have two ASP.NET applications, each deployed on the same Windows 2008 SP2+ box. We have our App Pool running in a Domain Account, and set to never re-cycle. The same 1 App Pool is used by both applications.
After several hours of running fine, new users surfing to a page in our application get the IIS7 Error Page, with a 500.21 error.
If we do nothing but:
1) IISRESET
2) Change folder to c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files and "rd" the 2 applications.
And then surf to our web applications, all is fine.
Then several hours later, however, the 500.21 errors return.
What strikes me as odd is the seeming relationship between clearing the "Temporary ASP.NET Files" folders and the problem going away. I've a practice of clearing the "Temporary ASP.NET Files" folders when installing a new version of our application(s), but not otherwise.
Does this relationship ring familiar to anyone? Is there some new-ish IIS7 feature at work here?
Text of Error:
Server Error in Application "DEFAULT WEB SITE/PAIS"
Internet Information Services 7.0
Error Summary
HTTP Error 500.21 - Internal Server Error
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
Detailed Error Information
Module IIS Web Core
Notification ExecuteRequestHandler
Handler PageHandlerFactory-Integrated
Error Code 0x8007000d
Requested URL http://localhost:80/PAIS/Admin.aspx
Physical Path C:\0_Georgia\GA_IS_100142\PortfolioArchiveImageServer\Admin.aspx
Logon Method Anonymous
Logon User Anonymous
Most likely causes:
• ASP.NET is not installed or incompletely installed.
• A configuration typographical error occured.
• Unfavourable pre-condition evaluation exists.
Things you can try:
• If ManagedPipelineHandler is missing, ensure that:
o ManagedEngine is in .
o ManagedPipelineHandler is in , with correct pre-conditions.
• Install ASP.NET.
• Ensure all system.webServer/handlers#modules are in system.webServer/modules#name.
• Review pre-conditions in the and sections.
Links and More Information IIS core does not recognize the module.
View more information »
Thanks in advance,
Howard Hoffman
Faced the same problem and the fix was easy.
1) Open visual studio 2010 command prompt.
2) Run the command aspnet_regiis.exe -i
We found the actual problem, with MS ASP.NET support's help. It's pretty subtle. I think MS has said they will fix the issue in a follow on to the App Fabric release (which is now RTM). Fingers crossed.
The problem consistently occurs in this scenario:
1) ASP.NET web application not yet running. It includes WCF Net.Pipe and / or Net.Tcp bindings. I think the same would occur for NetMsmq but did not try it.
2) An inbound NetPipe or NetTcp WCF Windows Activation Service request is the initial request that starts the App Domain.
3) Application uses an 'Integrated' IIS App Pool (IIS7 or IIS 7.5)
4) The application uses HttpServerUtility.Execute during that 1st request.
It turns out that our application was firing an ASP.NET Health Monitoring event during the very 1st WCF operation -- the very operation that caused Windows Activation Service (WAS) to start our application. Our Health Monitoring configuration includes the TemplatedMailWebEventProvider.
Our application is using an 'Integrated' IIS App Pool.
The TemplatedMailWebEventProvider is implemented to create an email message body as HTML. It uses the System.Web.HttpServerUtility.Execute(string, TextWriter, Boolean) overload.
For this use case that overload does the wrong thing -- it initializes a 'Classic' IIS App Pool based HTTP pipeline. Because that's the wrong pipeline for an 'Integrated' IIS App Pool the pipeline gets corrupted with the next HTTP request -- which is actually the first inbound HTTP request.
So you get the 500.21 error for all future HTTP requests until the application is re-cycled. You don't need to perform the relatively drastic steps of IISRESET, clearing Temporary ASP.NET cache to clear up the error -- just restart the app via saving web.config and avoid the particular startup path that causes the error.
MS suggested a workaround for us -- use the SimpleMailWebEventProvider instead of the TemplatedMailWebEventProvider. That does work, since it takes HttpServerUtility.Execute out of the code path for the first request.
I'd suggested that MS introduce a new web.config <system.web> boolean setting -- UseIntegrated -- that let's the application specify the typeof App Pool to initialize with. Evidently IIS does not forward the App Pool type to ASP.NET, so my sugggestion is a work-around to that.
The TemplatedMailWebEvent provider is much more user friendly than the SimpleMailWebEventProvider, and we do hope MS addresses the issue.
Thanks all for reading,
Howard Hoffman
1. IIS 7 throws an exception as shown in below
2. Open visual studio 2010 command prompt in Administrator mode and execute aspnet_regiis.exe -i
3. Problem fixed, as shown below ASP.Net Application and ASP.Net MCV Application are running smoothly.
The problem more likely is in the application code. The Temporary ASP.NET Files folder contains pre-compiled copies of your app and will be refreshed every time the applications files are accessed. You can pre-compile these files with aspnet_compiler.exe in the \Windows\Microsoft.NET\Framework\v2.0.50727\ folder. Use the -errorstack option allow for more information to be generated about the error you are getting. Long running applications that don't recycle will run into problems if they use a lot of memory or retain large amounts of data in an inproc session state. if your sessions contain large amounts of information, consider using a sqlserver-based session manager.