SilverLight Service Deployment - c#

I've written a silverlight app with a simple wcf service. Runs great on my computer, when I publish it to my web account it no longer works with the service. I tried editing the clintconfig file to set the endpoint to the new location, that did not fix it. So I downloaded this simple SilverLight App with WCF example setup for deploying, and it also works on my personal machine, but not when I publish it to my domain. My account supports asp.net, wcf, etc.. The link to the example I downloaded: http://www.codeproject.com/Articles/152778/Deploying-Silverlight-with-WCF-Services
I'm new to this, so I'm wondering if this is something that should work without additional work, or if I'm missing something. I'm not getting any errors, I'm just not getting the message displayed on the screen from the service.
Added following after Hatchets Comment:
I'm trying to figure out how to find a error message. So far the only way I know it's not working is I don't see the message that is returned from the service. SilverLight displays the returned message, "Hello from My WCF Service". I see it on my machine, but not when I publish it to my domain. The app I downloaded, if I understand it right, is setup to work without having to change the endpoint address, but i'm so new to this, I've not figured out what i'm missing yet.
Thanks.
Added after comments below:
I grabed fiddler, and after i added the tag, i was able to see an error in fiddler, and when browsing to the .svc file. Error:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'multipleSiteBindingsEnabled'. Note that attribute names are case-sensitive.
Source Error:
Line 30: </bindings>
Line 31: <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
Line 32: multipleSiteBindingsEnabled="true" />
Line 33: <services>
Line 34: <service name="testWCF.Web.Service1">
Source File: \boswinfs03\home\users\web\b706\whl.forystpcom\web.config Line: 32
Version Information: Microsoft .NET Framework Version:2.0.50727.4211; ASP.NET Version:2.0.50727.4016
I'm unfamiliar with multipleSiteBindingsEnabled and the best way to handle this, does the version of .NET running affect this? The server i'm running this on supports up to 3.5 it says, but I notice it quotes version 2.0 in the error, not sure if they are connected.

I know the example you're following is not RIA Services, and this link is, but it may be helpful as it goes over some common Silverlight/WCF services deployment problems
http://blogs.msdn.com/b/saurabh/archive/2010/03/16/ria-services-application-deployment.aspx

MultipleSitesBindingEnabled is part of the 4.0 update, so it can not run on a server that supports up to 3.5. You need to configure your service to use a specific endpoint(s).
Sourse: MSDN
P.S. When browsing to the .svc, it will say that .net 2.0 is installed for anything from 2.0 - 3.5 , but then 4.0 is installed it will say 4.0.

I'm not considering this the answer, just thought it was a cleaner place to put an update. My first problem was my program was using 4.0 and my provider did not support 4.0. My 2nd problem was: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.Parameter name: item" , I found a fix for this at: http://www.j2i.net/blogengine/post/2010/02/08/This-collection-already-contains-an-address-with-scheme-http-There-can-be-at-most-one-address-per-scheme-in-this-collectionParameter-name-item.aspx
I was able to fix this by adding the following code.
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://www.mydomain.com" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
Thanks to all the Help everyone. Thanks for carlosfigueira for the suggestion to download the fiddler app. If you want to repost that suggestion to a answer I'll check it, as it helped me figure out the errors I was getting, leading to solving the problem.

Related

IIS 10 can't read web.config (try to deploy Blazor), Error 500.19 with 0x8007000d [duplicate]

I am replicating web application deployment and found several issues related to HTTP Error 500.19. My machine is running Windows 7 while the working development is using Windows 8. We're developing our Web Application using Visual Studio 2010.
First, I got error code 0x80070021, similar as posted here.
I update my web.config according to the accepted answer and then I got following error code (which is similar as posted here).
HTTP Error 500.19 - Internal Server Error
Error Code 0x8007000d
Config Source -1: 0:
I have read the symptoms definition in Microsoft support page and cause of the error is:
This problem occurs because the ApplicationHost.config file or the Web.config file contains a malformed XML element.
and the solution is
Delete the malformed XML element from the ApplicationHost.config file or from the Web.config file.
However, the web.config that I used is working perfectly in the original development environment.
Here is what I have checked and tried so far:
Install ASP.NET by calling aspnet_regiis -i
Set my application to use different application pool (ASP.NET v4.0, .NET v4, etc)
ApplicationHost.config file is still using default from Windows 7.
This is part of my Web.Config
<system.webServer>
<section name="handlers" overrideModeDefault="Allow" />
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
</modules>
<handlers>
<remove name="UrlRoutingHandler" />
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<urlCompression doStaticCompression="true" doDynamicCompression="false"></urlCompression>
<directoryBrowse enabled="true" />
<defaultDocument>
<files>
<add value="Logon.aspx" />
</files>
</defaultDocument>
</system.webServer>
I have read similar/duplicates/closed posts (around 13) posts in stackoverflow, tried all except the answer related to Ajax (is it related) and still have no clue on what the error is.
Does anyone one how to fix this error? (And if possible, a comprehensive lists of things need to be checked so we can reduce similar posts like this.) I am ready to provide more details.
Error 0x8007000d means URL rewriting module (referenced in web.config) is missing or proper version is not installed.
Just install URL rewriting module via web platform installer.
I recommend to check all dependencies from web.config and install them.
When trying to set up a .NET Core 1.0 website I got this error, and tried everything else I could find with no luck, including checking the web.config file, IIS_IUSRS permissions, IIS URL rewrite module, etc. In the end, I installed DotNetCore.1.0.0-WindowsHosting.exe from this page: https://www.microsoft.com/net/download and it started working right away.
Specific link to download: https://go.microsoft.com/fwlink/?LinkId=817246
Yes, for .net core apps, install dotnet hosting. This worked for me.
And here it is for .net6
And now if you need .net7
Install URL rewriting:
UPDATE - this is now available here (and works with IIS 7-10):
https://www.iis.net/downloads/microsoft/url-rewrite
Ensure you have the following set to 'Allowed' for your IIS server:
In my case, because I had reinstalled iis, I needed to register iis with dot net 4 using this command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
In my case (.Net Core Web API) for this issue HTTP Error 500.19 – Internal Server Error 0x8007000d
First download dotnet-hosting-3.0.0-preview5-19227-01-win (.Net Core 3) or dotnetcore 2 hasting windows
https://download.visualstudio.microsoft.com/download/pr/5bed16f2-fd1a-4027-bee3-3d6a1b5844cc/dd22ca2820fadb57fd5378e1763d27cd/dotnet-hosting-3.1.4-win.exe
Any .net core 3.1 application either angular or mvc application would need this.
Second install it as Administrator
Open cmd as administrator, type iisreset, press enter
So refresh your localhost app
Best regard
M.M.Tofighi from Iran
A repair of the DotNetCore hosting bundle did the trick for me. :/
Installing ASP.NET Core Runtime Hosting Bundle solved the issue for me. Source: 500.19 Internal Server Error (0x8007000d)
Kind of late to the party here, but I have just been struggling with the exact same issue (symptoms) and cursing the lack of error detail reporting.
It worked fine on IIS 8+ machines but Win 7 got these INSTANT HTTP 500.19 errors.
For me it was as silly as having an unsupported configuration element in the config file:
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
So while running old web.config files worked fine, I just diffed them and started chopping away at new blocks until I got the page to start loading. Had I seen this as an answer I would have gone this route immediately as I knew none of the popular solutions were relevant. So there you go :)
I turn on .Net Framework 3.5 and 4.5 Advance Service in Control Panel->Programs and Features->Turn Windows features on or off.it work for me.
Problem solved. Here are the steps that I tried:
Enable the 32-bit application in IIS -> Application pool -> Advanced settings
Copy System.EnterpriseServices.dll and System.EnterpriseServices.Wrapper.dll from C:\Windows\Microsoft.NET\Framework\v2.0.50727 to the application bin folder
Do comments/uncomments to sections on the web.config and found that problem related to the referenced DLL.
The config that I commented the previous one that I added:
<section name="handlers" overrideModeDefault="Allow" />
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow"/>
Add the required FasterFlect.DLL used by Combres.DLL v2.1.0.0 to the application bin folder (shall download the full zip from Combres codeplex, because the required fasterflect DLL V2.0.3732.24338 cannot be found in fasterflect codeplex) and other DLLs. For convinience, use the full Combres.DLL (1,3MB)
Check that the DLL versions and public key tokens are configured correctly in web.config using tool, e.g. .NET Reflector
I understand that this error can occur because of many different reasons. In my case it was because I uninstalled WSUS service from Server Roles and the whole IIS went down. After doing a bit of research I found that uninstalling WSUS removes a few dlls which are used to do http compression. Since those dlls were missing and the IIS was still looking for them I did a reset using the following command in CMD:
appcmd set config -section:system.webServer/httpCompression /-[name='xpress']
Bingo! The problem is sorted now. Dont forget to run it as an administrator. You might also need to do "iisreset" as well. Just in case.
Hope it helps others.
Cheers
For me, it was all about setting up my web server to use the latest-and-greatest tech to support my ASP.NET 5 application!
The following URL gave me all the tips I needed:
https://docs.asp.net/en/1.0.0-rc1/publishing/iis-with-msdeploy.html
Hope this helps :)
I had this problem with a brand new web service. Solved it by adding read-only access for Everyone on Properties->Security for the folder that the service was in.
I had the exact same error. It turned out that it was something was caused by something completely, though. It was missing write permissions in a cache folder. But IIS reported error 0x8007000d which is wildly confusing.
I have the same problem when I was trying to publish asp.net core 5.0 web app on my local IIS and the solution was to add the following inside System.webserver tag in my web.config file
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
Reinstalling ASP.NET Core Runtime - Windows Hosting Bundle Installer made the trick for me... I belive the "ASP.NET Core Module" was missing.
For me I had a web.config file in one my root folders, this config file was for the live server so removing it allowed the site to run on the dev server.
So check for any web.config files in folders too.
In my case, i have installed dotnet hosting but error change to HTTP Error 503. The service is unavailable, but after install windows update KB2999226 and dotnet sdk, its work!
follow the procedure chronologically or it might fail due to missing or errors in redirecting.
install Runtime bundle e.g.. dotnet-sdk-7.0....
2.turn asp services on and internet services"Turn Windows features on or off" to enable IIS
3.install web hosting bundle iis 7.0 e.g dotnet-hosting-7.0.2...
this worked for me

.Net WCF SVC Info Page and Fully Qualified Server Names

I have two servers on which the identical .net 2.0 WCF service code has been deployed. On both servers the code is running in a dedicated web application with a dedicated application pool assigned to it. Both the web applications and the application pools are configured, as near as I can tell from IIS, identically on both machines. Furthermore, both machines have the same exact versions of the .net framework installed.
On one server the SVC info page served up by IIS lists a fully qualified machine name but the other lists a non-fully qualified machine name. I've provided sample URLS to the info page and the results below:
://server1:1995/Service.svc yields:
You have created a service. To test this service, you will need to
create a client and use it to call the service. You can do this using
the svcutil.exe tool from the command line with the following syntax:
svcutil.exe ://server1.domain.com:1995/Service.svc?wsdl
://server2:1995/Service.svc yields:
You have created a service. To test this service, you will need to
create a client and use it to call the service. You can do this using
the svcutil.exe tool from the command line with the following syntax:
svcutil.exe ://server2:1995/Service.svc?wsdl
I wouldn't normally care about this except for the fact that a packaged product I'm using appears to insist that the URL I give it for the WSDL match exactly what the info page states and I can't figure out why it needs to be different for these two (seemingly identical) machines.
Any help would be greatly appreciated!
(please note I had to delete "http" from the hyperlinks above to keep StackOverflow happy)
The solution here was to add the following line to the SVC web.config file. The behavior was inconsistent across different versions of IIS (and possibly the .net CLR) but adding this line normalized the behavior:
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

Build error after upgrade Azure SDK from 2.4 to 2.6

I just upgraded my web role project (and solution) from Azure SDK 2.4 to Azure SDK 2.6 using the upgrade functionality under project properties > application.
When I am building my application, everything works well but when I try to run it (and start up the Azure emulator and such) it gives the following error when I click "NO" if I want to proceeed with build errors:
unable to get setting value Parameter name: profileName
See build output:
Nothing more. When I open my output I can not find anything related to this. It looks like the build is done successfully.
If I click "YES" VS serves a popup with this message:
Failed to debug the Microsoft Azure Cloud Service project. The output
directory "D:\path\to\folder\src\project\csx\O" does not exist.
Maybe it has something to do with the emulator?
Can some one help? Much appreciated!
We also encountered this issue.
It appears that even if the Service Configuration you've selected in the Run/Debug settings is say, Dev.Local - you need to have a service configuration called ServiceConfiguration.Local.cscfg or you'll encounter this precise error.
At any case, once we created a cscfg called ServiceConfiguration.Local.cscfg this problem ceased, even though we were not referencing it.
It's something nasty about diagnostics which the 2.7 upgrade (in my case) attaches everywhere. Remove diagnostics from your roles (web.config, role definitions) and I bet you'll have some luck.
Update: we never got to the bottom of this. Unless you are happy without diagnostics, life really is simpler if you just give in and make sure you have a Foo.Local.cscfg!
This seems to be a catch-all error. I've just encountered it, and the root cause in my case appears to be that I had the thumbprintAlgorithm for a certificate incorrectly set. I found this out when I tried to Package... it and got a useful error message, so that's one thing to try.
Check if you have an XML syntax error in ServiceConfiguration.Cloud.cscfg

500.19 - Internal Server Error - The requested page cannot be accessed because the related configuration data for the page is invalid

Before everyone reads this, I just want to say that i know that there are related threads out there, but I have either tried them or do not understand. With that being said here goes nothing...
I am trying to get a MVC Web App running in my IIS. Unfortunately, I am absolutely stuck on this error:
HTTP Error 500.19 - Internal Server Error
The Request page cannot be accessed becasue the related configuration data for
the page is invalid.
Module: IIS Web Core
Notification: BeginRequest
Handler: Not yet determined
Error Code: 0x80070005
Config Error: Cannot read configuration file due to insufficient permissions
Config File: \foo\web.config
Request URL: http://localhost/WEBAPP
Logon Method: Not yet determined
Logon User: Not yet determined
Config Source
-1:
0:
I am not quite sure what else to do. I have also tried giving read permission to the web.config file and that did not seem to work.
If anyone has any information or would be able to help me work through this it would be much appreciated. Thanks!
In my case I needed to install the IIS URL rewrite module 2.0 because it is being used in the web.config and this was the first time running site on new machine.
On this MSDN blog: Troubleshooting HTTP 500.19 Errors in IIS 7 in scenario 8 for error code 0x80070005 (E_ACCESSDENIED - General access denied error) it says:
Grant Read permission to the IIS_IUSRS group ...
.... the worker process identity (and/or the IIS_IUSRS group) needs at least Read access to the directory so that it can check for a web.config file in that directory.
Please follow these step
Go to Control Panel
Go to Programs and Features
Turn Window Feature on or off
Go to Internet Information Service node
Follow World wide web Services
Then Please Check Application Development Feature
Then Please check all Node Specially Asp or Application Framework Like Asp.net 3.5 or ASP.NET 4.5 whatever you have
I fixed this by restarting VS.
I had opened a config file in another instance of VS and apparently sth went nuts...
Goto Windows Features on or Off . Enable All Features under Application Development Features and Refresh the IIS. Its Working
I was trying to run a .net core 3.1 site from IIS 10 on windows 10 pro box, and got this error. Did the following to resolve it.
First turn on the following iis feature on.
Then follow the link below.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1#install-the-net-core-hosting-bundle
Install the .net core hosting bundle.
The direct link is
https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.2-windows-hosting-bundle-installer
I have installed the .net core sdk and run time as well. But this did not resolve the issue.
What made the difference is the .net core hosting bundle.
I had a sub folder named web.config renaming this folder resolved the issue
For completeness, the answer to Asp.Net Core tag in web.config causes failure may also be the solution to the problem here. If the .NET Core Windows Server Hosting bundle is not installed then IIS cannot recognize the aspNetCore section in web.config. https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1#install-the-net-core-hosting-bundle claims to be a direct download to the current version.
I tried all solution above. My issue is resolved after reinstalling hosting bundle.
I installed hosting bundle before in IIS Manager installation.
I think this is caused error. Don't know why, but, the reinstallation works.
My issue is that I accidentally installed another site as the default site instead of the IIS default (by opening another project.) I had to remove the default site and repoint it to the default location C:\inetpub\wwwroot using my domain login as the user to bypass with then just reopened my project that I was trying to run (the one showing this error) and it was all honky dorry
I was accessing the project from inside a Virtual Machine - sharing the project folder from the host OS (Windows 10). After trying many of the solutions, and even ensuring the permissions for the IIS_IUSRS are given, still I could solve this.
Eventually, I copied this folder from the host, onto a path on the guest OS, and now I can properly run that same ASP.NET project without ado. But, I did also go ahead and give the IIS_IUSRS group full control over this new dir as well... maybe that's not really necessary in this case? I'm lazy to test that ATM.
Delete .vs/Config folder => work for me
In my case I had .Net core SDK 3.1.403 was installed. So I installed the corresponding .Net Core Windows Server Hosting which is .NET core 3.1.9 - Windows Server Hosting.
I had this problem to run restful service on IIS in Windows 10 and Windows Server 2019, finally after a lot of researches I solved the problem. After performing the following steps, the problem will most likely be solved.
Go to the "Windows Features" and active full features IIS ("Internet Information Services" or "Web Server") and active .Net Features
Locate the source at "C:\inetpub\wwwroot"
Open IIS
Click "Edit Permissions" on your web after go to the security tab and give full
access to the IIS_IUSRS
Go to the "Application Pool" next right click on your app pool after click on "Advanced settings" and change "Identity" to "LocalSystem"
Go to the "Application Pool" next right click on your app pool after click on "Basic settings" and change ".NET CLR Version" to "No Managed Code"
If you want to set the service to a specific port, first set it to port 80 and then edit it and set your port
Well now if the problem is still not solved then install the following software on the system :
URL Rewrite 2
WebPlatform
DotNetCore.2.0.8 Windows-Hosting
Dotnet-hosting 5
Dotnet-runtime 5
MicrosoftServiceFabricSDK 5
NET.Framework 4.8
and finally restart the system.
If Folder getting from other, and host file is already generated on ProjectName\.vs\config folder, then it conflicts with a new one and gets this error.
So delete host file from ProjectName\.vs\config and restart project once again. It was worked for me
In my case, Server had lower version framework than your application. installed latest version framework and it fixed this issue.
In the Edit Application Pool window, set the .NET CLR version to No Managed Code
I had this error with Visual Studion 2019, my project was NopCommerce 4.30 which is an ASP.Net Core 3.1 project. I added page "gouden-munten-buitenland" to be the starting page and I only got the error when going to that page. Turned out that Visual Studio generated an invalid applicationHost.config :
<applicationPools>
....
<add name="gouden-munten-buitenland AppPool" autoStart="true" />
<add name="gouden-munten-buitenland AppPool 2" autoStart="true" /> <!-- WRONG -->
<add name="Nop.Web AppPool" managedRuntimeVersion="" />
<applicationPoolDefaults managedRuntimeVersion="v4.0">
<processModel loadUserProfile="true" setProfileEnvironment="false" />
</applicationPoolDefaults>
</applicationPools>
and
<sites>
....
<site name="Nop.Web" id="2">
...
<application path="/gouden-munten-buitenland/gouden-munten-buitenland" applicationPool="gouden-munten-buitenland AppPool">
<virtualDirectory path="/" physicalPath="C:\Usr\Stephan\Wrk\Kevelam\kNop.430\Presentation\Nop.Web" />
</application>
<application path="/gouden-munten-buitenland" applicationPool="gouden-munten-buitenland AppPool 2">
<virtualDirectory path="/" physicalPath="C:\Usr\Stephan\Wrk\Kevelam\kNop.430\Presentation\Nop.Web" />
</application> <!-- WRONG -->
....
</site>
...
</sites>
I removed the nodes identified as 'WRONG' and then it worked.
If your error is using a site in asp.net core, install the ASP.NET Core Windows hosting bundle.
Click on the link below and select your .net core version
In the following page find the link "Hosting bundle" (ctrl+f may help) and install it.
Worked a treat for me!
https://dotnet.microsoft.com/en-us/download/dotnet
One reason, for which I face this issue was a web.config file in Images folder (on abnormal location) and IIS was trying to allow the read rights according to incorrect settings in the web.config file.
Therefore make sure your build is correctly deployed without any abnormal files specially the configs one on invalid locaiton.

Site unavailable while service status is 'running'

I recently updated my project to use SDK 2.0 and tried to publish it to staging environment. Visual studio reported success but there is nothing at the site generated URL, just a "webpage not available" or whatever is the default browser message for not existing URLs. In Azure management portal however the status is RUNNING and there is even some curve in CPU percentage chart. I updated all references in my role project to be the same as in blank new azure project for 2.0 sdk version, the only new references are added by 'Identity and Access tool' for OAuth purposes. Can anyone tell me what can be possibly wrong or how can i figure this out myself? I enabled diagnostics, but it shows 0 errors in every tab. Of course everything runs fine in my local environment
upd: my problem was actually quite simple: something went wrong with port forwarding and i had to add :8080 to url explicitly, so i removed all of my endpoints and added just a simple port 80 one with no internal port set. The accepted answer pointed me the way to discover this problem
Visual Studio and Azure Management Portal only report that the server is up and running. They have no way of knowing if there is an actual issue with the code or deployment.
Webpage not available is not the same as 404 nor is it the same as dns not found. Webpage not available usually means a server error of some kind. Most likely some .DLL's are missing from deployment
If you are running on WebRoles, you can RDP into the server and look into the Windows Event viewer to see if any errors occur
Alternatively, you can turn off custom errors via web.config (check this link out for sample directions: http://www.serverintellect.com/support/programming/custom-errors.aspx )
At the end of the day, you need to find out what is the real cause of the issue
Make sure you have the following in your web.config. Mine is added just before the line
<customErrors defaultRedirect="GenericError.htm" mode="Off">
<error statusCode="500" redirect="InternalError.htm" />
</customErrors>
If you are using web.config transforms and have a web.debug.config you add the following code to it:
<customErrors mode="Off" defaultRedirect="GenericError.html" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
You still have to make sure you have a custom errors section in your web.config for the replace to happen.

Categories

Resources