Global.asax stopped executing after installing aspnet_regbrowsers.exe utility - iis-6

After running "aspnet_regbrowsers.exe -i" utility my Global.asax file stoped working when site is deployed on IIS 6 (on dev environment everything is fine). Application_Start and Aplication_End events are not firing. Here is a question with the same issue: Global.asax Events not firing in IIS 6
I used aspnet_regbrowsers utility to enable ASP.NET 2.0 to recognize modern browsers, such as Chrome.
Is it possible to have both: Global.asax executing and aspnet_regborwsers installed? How?

I have solved this issue by moving from machine-level browser definitions to application-level browser definition, located in App_Browsers folder. I had to modify some of *.browser files from .net 4.0 (http://aspnet.codeplex.com/releases/view/41420) so they compile after placing in App_Browsers folder.

Related

.NET Core - Self Contained Deployment not working

I have a .NET Core Web Application. I'm using the publish command to create a self contained deployment.
It creates the files and appears to create .net core dlls, but when runnning in IIS on Windows 10, I still need to install the .NET Core Runtime to get it to work. After installing .NET Core Hosting bundle it works fine.
I have reviewed a lot of other posts before asking, but can't find the answer.
By default IIS gives the following error:
HTTP ERROR 500.19 – Internal Server Error
My Publish command:
dotnet publish "mydirectory\mywebsite.csproj" --self-contained --framework netcoreapp2.1 -r win10-x64 -c Release
The csproj looks like this:
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<UserSecretsId>aspnet-mywebsite-656GASF8-B9H4-5963-1038-5D735B609E15</UserSecretsId>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
</PropertyGroup>
Here are the published files.
I thought maybe the 'l1-1-0' part might be the wrong framework version, but my dotnet version is 2.1.500.
What do I need to do to get it to work please?
Lex Li's comment/ blog post contains the answer. I'm detailing it here to try to save someone else losing days to this simple misunderstanding.
A self contained deployment does indeed include the runtime, but
it doesn't include the ASP.NET Core module for IIS which you get
when you download the Runtime & Hosting Bundle from the .net downloads
page.
So if you are deploying to IIS, you will need to run the Runtime & Hosting Bundle installer even for a self contained deployment.
A self contained deployment just means the application will use the .NET Core Runtime packaged with the application rather than whatever is installed on the machine.

Getting Error <location allowOverride="false"> while hosting WEB API 2 in Hostgator

I am using WEB API 2 its working in my local system,but when WEB API 2 run in Hostgator windows server its given me error below is my error screenshot
http://prntscr.com/bc5ihv
As I commented, I got similar problem while hosting web api on shared hosting.
The solution is to remove Microsoft.CodeDom.Providers.DotNetCompilerPlatform package and clean and build
You can deploy even without Roslyn with no change in code. Open NuGet Package Manager window and uninstall Microsoft.CodeDom.Providers.DotNetCompilerPlatform package and rebuild & republish. This uninstallation also removes CodeDom configuration from web.config file. This will solve your purpose. Basically this will not generate any csc.exe, vbc.exe files inside bin folder.
I got it from here

How to run DotNetNuke 6.2 under asp.net 4.0

I just installed dnn 6.2 fresh as a .net 3.5 application on windows 7 under iis 7.5 using the default app pool. I then go and change the default app pool to .net 4.0, load up my site, and get an iis 7.5 error - IIS 7.5 Detailed Error - 500.21:
...
...
Most likely causes:
Managed handler is used; however, ASP.NET is not installed or is not installed completely.
There is a typographical error in the configuration for the handler module list.
Things you can try:
Install ASP.NET if you are using managed handler.
Ensure that the handler module's name is specified correctly. Module names are case-sensitive and use the format modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule".
Everything I've read on this says to only perform two steps:
change the app pool to run under .net 4.0 (restart app pool)
pull up your site and dnn will make the necessary changes to the web.config file
Note: the default app pool has modify permissions on my website folder and all sub folders/files.
How can I fix this error and get dnn to run under asp.net 4.0?
Thanks for any help!
This happens to me quite a bit when setting up a new machine. You need to register ASP .NET 4.0 with IIS you do that by using
aspnet_regiis
http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx
So go to your .net 4 directory from your command line, path will be something like this.
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\
then in that directory run
aspnet_regiis.exe -ir
That will re-register 4.0 with IIS and you should be all set.

IIS Managed Module in .NET4

I want to write a Managed Module for IIS 7.5 using .NET 4.0 because I want to use the new MemoryMappedFile class.
I started with a small prototype compiled with .NET 4.0 and tried to integrate it into the IIS without success.
The module is strong-named and I could install it into the GAC. After that I added it through the IIS Manager but the worker process doesn't seem to load it as I cannot debug the module by attaching the debugger to w3wp.exe. The AppPool also runs with .NET 4.0.
Any ideas about that?
Thanks,
Simon
I solved it. I had to uncheck the "Invoke only for requests to ASP.NET applications or managed handlers" checkbox. After that the module worked as expected.

aspnet_client folder within IIS website

I want to know how to permanently remove the aspnet_client folder under some of our websites in IIS.
Our application does not require it, and scripts against these folders fail due to the folder permissions on this folder.
Even the .NET 4 install continues to add this folder. There doesn't seem to be a permanent way to delete the folder, outside of deleting it after registering .NET with IIS, or after installing a new version of the .NET Framework.
Some people say they throw a read-only attribute on the directory, but ... that still keeps the directory hanging about.
See my answer to a similar question, Prevent aspnet_client folder being added to .NET sites
To reiterate that answer:
Check out the MSDN documentation on the ASP.NET IIS Registration Tool (Aspnet_regiis.exe). There's an e and ea command line switch you should be able to use to clean it up after the fact.
You can use Aspnet_regiis.exe to install and remove system client-side script, such as script for client-side validation. Use the -c option to install client script for the version of ASP.NET that is associated with the tool. (Script is installed in the Aspnet_client subdirectory of each IIS site directory.) To remove the client-side script for just the ASP.NET version that is associated with the tool, use the -e option. To remove the client-side script for all installed versions of ASP.NET, use the -ea option.
(Emphasis added.)