SignalR runs on visual studio expres but not on iis - signalr

this is the error message
SCRIPT5022: SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g.
this is my project link :
https://drive.google.com/open?id=12bo73vYOEODXR9lY3tKmIGj7z0_Q1b0L

May be your application not running.
Add this settings ==>
<appSettings>
<add key="owin:AutomaticAppStartup" value="true" />
<add key="owin:AppStartup" value="SignalRChat.Startup" />
</appSettings>
behind the <configuration> in your web.config to startup your owin application.
EDITED ==>
or learn more SignalR Windows supported platform here https://learn.microsoft.com/en-us/aspnet/signalr/overview/getting-started/supported-platforms
Your application work(s) fine in Windows 8.1 ==>

Related

Issue with web.config in Web API

I'm working on my first real world .Net Core 3.1 Web API and I'm getting an error with the web.config file but don't know what's wrong.
I create the Web API locally and it tests out just fine. I published the project to a local folder and then copied it out to IIS on our STAGE server. When I open IIS and click on any of the icons for the project (in this case I clicked the Logging icon) and I get an error "There was an error while performing this operation" and the file name points to the web.config in my folder structure.
The web.config file is created automatically when I publish the project. Anyone see what the issue could be with the web.config that's causing the problem?
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\AvTechAPI.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 24142d05-13a1-4655-b2b8-8f8456003615-->
Windows IIS
Solution: Install the hosting bundle.
Reason: Although the SDK normally contains the runtime, however, it seems the SDK installer is not registering the runtime correctly on the server.
Workaround (not recommended):
Change AspNetCoreModuleV2 to AspNetCoreModule inside web.config.
Azure platform hosting
Install the .NET Core runtime extension by selecting Extensions and then installing .NET Core Runtime.

Can't deploy MVC application to IIS - Is my web.config file to blame

I'm struggling to deploy any MVC application onto IIS in a windows 10 environment.
I always get an HTTP error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid. It goes on to suggest there is a problem reading the configuration file.
On a similar post on this site it was suggested that asp.net was not installed but I'm certain that I've done it. I've used the Aspnet_regiis.exe tool and followed the instruction on the link below.
http://www.jammer.biz/enable-asp-net-on-windows-10/
The webconfig file as it came out of visual studio 2017 when I published is as follows:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\HelloWorld.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: e88818e3-e6fd-4105-94cc-5be77ed93582-->
I've not edited it since none of the tutorials I've followed it tell me to.
I've made sure that full access rights on the folder are granted.
Here is the error message as seen from in IIS.
Why is IIS struggling to read my config file?
Thanks in advance.
Ian
I had this same issue when trying to publish a .NetCore2.0 mvc app. The solution can be found here: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.1&tabs=aspnetcore2x
In my case, I did not have the .NET Core Hosting Bundle installed.

Changing from .NET 3.5 to 4.5.1 causes app not to run

I have a .NET web application that was originally running on .NET 3.5 but upgraded it to .NET 4.5.1. When I attempt to run the application, I get the following 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 'targetFramework'. Note that
attribute names are case-sensitive.
Source Error:
Line 63: debugging ASP.NET files.
Line 64: -->
Line 65: <compilation defaultLanguage="c#" debug="true" targetFramework="4.5.1" />
Line 66: <!-- CUSTOM ERROR MESSAGES
Line 67: Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Version Information: Microsoft .NET Framework Version:2.0.50727.8745; ASP.NET Version:2.0.50727.8745
As you can see by the last line, this application is still using .NET Framework verison 2.0.50727.8745.
I asked my colleague to open the solution after getting it from source control and run it and it uses .NET 4.0.* and he doesn't see this error. This leads me to believe there is something wrong with my machine. I have looked in the applicationhost.config and I don't even see my application listed, much less anything regarding which .NET version it's using. Why would it work on his machine and not mine? I have a bug fix I need to implement and if I can't run the application that isn't going to happen.
Change your app pool to use v4.0 runtime. It is entirely possible that the machine it is failing on does not even have v4.0 runtime installed.
This is because of IIS Express config applicationhost.config which is located in .vs directory. It contains application pool assignment to your project:
<system.applicationHost>
<applicationPools>
<add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
<add name="Clr4ClassicAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
<add name="Clr2IntegratedAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
<add name="Clr2ClassicAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
<add name="UnmanagedClassicAppPool" managedRuntimeVersion="" managedPipelineMode="Classic" autoStart="true" />
<applicationPoolDefaults managedRuntimeLoader="v4.0">
<processModel />
</applicationPoolDefaults>
</applicationPools>
<sites>
<site name="YourWebSite" id="2">
<application path="/" applicationPool="Clr2IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\YourWebSite" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:46397:localhost" />
</bindings>
</site>
</sites>
</system.applicationHost>
You can change the pool your project uses... in theory. I tried but it didn't help. The working solution is to remove .vs directory and open your solution again. .vs directory will be created again with correct config.

VSTS Build With Local Nuget Package From Local Nuget Server

Has anyone had success building an ASPNET5 application in VSTS with a local (not public facing) Nuget server as a feed? Following these steps: https://msdn.microsoft.com/Library/vs/alm/Build/azure/deploy-aspnet5 I can see the script restoring but it always errors out on my local package. I am sure I am configuring something wrong. This is what I have tried:
Add a Nuget Installer task with a arg to my solution and NuGet arguments nugete.exe -source "https://www.nuget.org/api/v2/;http://mynugetserver" (and I tried including no Nuget arguments and including a Nuget.config in the root of my solution). However, the build runs into a an exception saying it cant find the local url: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'mydomain'. Okay I understand that, but I do I get it to recognize a local URL?
After researching I thought I would have to use the Package Manager Extension for VSTS. So I loaded my packaged on there successfully, but when I included that package URL in my Nuget.config I get a bunch of unauthorized responses from the PreBuild.ps1 because it is trying to look at the VSTS package URL too. And that is where I am now.
Current Nuget.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<config>
<!--DO I NEED TO INCLUDE MY PROXY INFOR HERE I AM BEHIND ONE AT WORK-->
</config>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<activePackageSource>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</activePackageSource>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="Local" value="https://vstsurl/DefaultCollection/_packaging/Local/nuget/v3/index.json" />
<add key="Company Nuget Gallery v2" value="http://mydomain/nuget/api/v2" />
</packageSources>
</configuration>
UPDATE
if I use the Package Manager on VSTS these are the warnings / exceptions all which seem to come from the local feed. not sure why it is using the local feed for all the external packages
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
... other exceptions here
----------
Restore failed
If you are using the build agent hosted by VSTS and your nuget server is in local (Cannot access from internet), the package restore will fail since the build agent cannot find your nuget server. You'd either configure your nuget server so that it can be accessed from internet or deploy your own build agent in the same intranet with your nuget server.

Unobtrusive Oracle Deployment on Windows Server 2008

I have a .NET 4.0 Web Forms app that I am running with the beta Oracle EF-aware data provider, and I want to perform "unobtrusive" Oracle deployment to a Win2K8 box, as shown in many SO solutions.
There is an existing Oracle Instant Client installation on the Win2K8 box, which I can neither work with nor remove, and it has an entry in the PATH environment variable on the Win2K8 box. According to this SO answer, I do not need to set PATH for my Oracle DLLs, since I have DllPath set in the web.config.
I am following the procedure from here, yet I still get the provider is not compatible with the version of Oracle client error.
Here's my (unsuccessful) setup, as of now:
Oracle DLLs are in my web app's bin directory, and set to Copy Always Do Not Copy.
Platform and Platform Target settings are set to x86 in my local Build Configuration.
32-bit applications are enabled in the app pool (.NET 4.0) on the Win2K8 box.
Oracle DLLs are not present in the GAC, not are they present in the GAC_32 and GAC_64 directories on the Win2K8 box.
My web.config (but not my Win2K8 machine.config) contains this:
<configuration>
<configSections>
<section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<oracle.dataaccess.client>
<settings>
<add name="DllPath" value="C:\inetpub\wwwroot\myapp\bin"></add>
<add name="FetchSize" value="65536"></add>
<add name="StatementCacheSize" value="10"></add>
<add name="TraceFileName" value="c:\temp\odpnet2.log"></add>
<add name="TraceLevel" value="0"></add>
<add name="TraceOption" value="0"></add>
</settings>
</oracle.dataaccess.client>
<system.data>
<!-- Version=4.112.2.50 -->
<DbProviderFactories>
<add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.2.50, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
<connectionStrings>
<add name="MyEntities" connectionString="metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;provider=Oracle.DataAccess.Client;provider connection string="DATA SOURCE=**<using EZCONNECT format here>**" providerName="System.Data.EntityClient" />
</connectionStrings>
<configuration>
The app itself deploys successfully, and I can run pages that do not reference my Oracle DLLs. But, for those that do reference Oracle, I still get the provider compatibility error.
What am I missing?
Thanks again for the help.
UPDATE: The web app runs on the Win2K8 target with .NET 4.0, EF4.1, and the Oracle EF Provider, completely separate from the other active ODAC install. No PATH variable, no installation from Universal Installer, no Oracle DLLs in GAC.
Case closed. I was missing an Oracle DLL.

Resources