Getting Error <location allowOverride="false"> while hosting WEB API 2 in Hostgator - asp.net-web-api2

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

Related

IronPDF - Use different nuget source for downloading platform specific dependencies

Our dev environment is behind Firewall and default NuGet url is blocked and we use a custom NuGet repo url for downloading package.
IronPdf tries to download IronPdf.Native.Chrome.Windows version 2022.2.4868 in runtime from https://www.nuget.org/api/v2/package/IronPdf.Native.Chrome.Windows/2022.2.4868 which is blocked and returns error message saying Failed downloading NuGet package at runtime
I have tried manually adding that package to the project but it is still not included in the build output and IronPdf again tries to retrieve from NuGet
How to
Include the Native package in deployed output
OR
Configure NuGet source in IronPdf
As the comment under your post suggests, this is most likely a permission issue with your temp or bin directory where IronPdf is attempting to deploy the dependencies it extracts from that package.
In our case, IronPdf was attempting to deploy the Chrome dependencies to, \runtimes\win-64x\native, in our deployment directory. We use service accounts for our IIS App Pool Identities, so we gave full permissions over the entire deployment (web) directory where the IIS Web Site is pointing to and the issue was resolved.

AspNetCoreModule Not Appearing in Modules list for website in IIS, even after installing Windows Hosting Bundle

I am trying to run a .Net Core 2.1 Website through IIS. I had to reinstall IIS recently and was getting the error when navigating to my website:
Handler "aspNetCore" has a bad module "AspNetCoreModule" in its module
list
So I downloaded and installed the Windows Hosting Bundle for the relevant version of .Net Core from here https://dotnet.microsoft.com/download/dotnet/2.1
I then restarted IIS but I am getting the same error.
I noticed in the IIS Modules page for the ASP.Net Core Website I am trying to run, there is still no AspNetCoreModule listed. I take it it should be appearing here after installation of the bundle?
Any ideas what could prevent the installer adding this module?
This error can occur if the AspNetCoreModule is not installed properly in IIS on the computer that is running the Microsoft Dynamics NAV Web Server components. To resolve this issue, open Programs and Features in Control Panel and check whether Microsoft .NET Core Windows Server Hosting is installed. If it is installed, repair it from Programs and Features, by selecting it, choosing Change, and then choosing Repair.
I also noticed that the SDK downloaded in the link you provided has x64 and x86. please check if you had downloaded the correct version.

ASP.NET Core IIS Deployment Issue aspnet-prerendering

I am having an issue deploying an ASP.NET Core app with Angular2 to IIS.
Steps so far -
Created a starter Angular2 asp.net core project with aspnetcore-spa generator following this
Played around with some angular code and was able to debug in VS2015 as well as command line. At this point the code is running
Got IIS setup following this
Using VS2015 published to a folder. Created a new IIS app and pointed to that folder.
Point the browser and get an error
An error occurred while processing your request.
Log file shows
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: Call to Node module failed with error: To use prerendering, you must install the 'aspnet-prerendering' NPM package.
System.Exception: Call to Node module failed with error: To use prerendering, you must install the 'aspnet-prerendering' NPM package.
The node_module folder with aspnet-prerendering is in the output folder.
One last thing to test that IIS is working, I created a basic project from VS template for .NET core and was able to get IIS working for a basic application. No npm dependencies.
Thanks for any direction on this.
I had the same problem, and after a few hours of unsuccsessfull attempts to resolve the error I created a new ASP.NET Core Web Application from VS2015 templates and just copied all .json and webpack config files, both ClientApp and typings folders into it. Also I updated Views folder from my project. I didn't replace web.config (I think web.config may cause the problem, but I'm not sure). After these actions everything seems to be working properly.
Also, I added <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> to my .xproj file because of this problem.

VB.NET Azure deployment has no /bin but has a nuget package

I've just published (via GitHub) a VB.NET Azure Website that works fine on local machines but not on Azure:
Compiler Error Message: BC30451: 'Newtonsoft' is not declared. It may
be inaccessible due to its protection level.
Dim category As Category = Newtonsoft.Json.JsonConvert.DeserializeObject(Of Category)(json)
The Newtonsoft.Json package is installed via NuGet: Newtonsoft.Json.5.0.5.
It's the only 3rd party dll in the project right now.
I used the Azure ftp access to browse to /site/wwwroot/ and noticed that there is no /bin directory.
Now, my .gitignore excludes [Bb]in and [Oo]bj folders, but it's the same .gitignore I've used successfully with c# projects and always assumed that Azure just fetches the missing nuget dlls from /packages.
This is my first VB.NET > GitHub > Azure Websites deployment. What have I missed?
edit: I can confirm that if I upload /Bin/Newtonsoft.Json.dll via Azure ftp the site works. Or at least it will until it's re-imaged...
Sounds like you've not enable "NuGet Package Restore".
By doing so this creates a .nuget folder at the root of your solution and a packages.config file in the application that the build process in Azure will pick up and load the required references from.
Right click on the solution and it should be an option in there.

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.)