ajaxcontroltoolkit missed when trying to republish published files on another machine or my local IIS - iis

I have a published web application on specific server. I want to run the same application on another IIS server, but i get this error
Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied.
Exception is here

Installing Report Viewer fixed it.
The problem was that my web.config was targeting .NET 2.0 and has some configuration related to .NET 2.0. I've updated the solution projects to target .NET 4.0 which need the report viewer dll in GAC folder or something global and that's what report viewer installer will do.

Related

How to install Microsoft Reportviewer exe in web apps service hosted in azure?

In my application we have referred below two dlls:
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.WebForms.dll
with the ReportViewer version 2010
But after deploying to azure web apps I am getting exception that the .rdlc file is invalid where as it works in local dev environment. In local environment I have installed the reportviewer installer.
Below is the exception:
An error occurred during local report processing.
The definition of the report 'Reports\Report1.rdlc' is invalid.
Is it possible to access the system drives and install reportviewer.exe in web apps?
Or please suggest me a way so that the rdlc files can be generated
Here is the resolution:
Add Microsoft.ReportViewer.ProcessingObjectModel.dll in project reference along with Microsoft.ReportViewer.Common.dll and Microsoft.ReportViewer.WebForms.dll
Make sure Microsoft.ReportViewer.ProcessingObjectModel.dll, Microsoft.ReportViewer.Common.dll and Microsoft.ReportViewer.WebForms.dll are present in bin folder in deployed environment.
Note: Make sure all the dlls are of same version.

ASP.NET Core 2.0 app targeting .NET 4.6.1 fails to host on IIS

The problem
IIS ASP.NET Core module is unable to start an ASP.NET Core 2.0 app.
Browser: HTTP Error 502.5 - Process Failure
Windows Event Log: Application ‘MACHINE/WEBROOT/APPHOST/AppSite’ with physical root ‘C:\inetpub\apps\AppFolder\’ failed to start process with commandline ‘C:\inetpub\apps\AppFolder\App.exe’, ErrorCode = ‘0x80004005: 1’.
ASP.NET Core Module Log: Log file is created but is empty.
The setup
App: ASP.NET Core 2.0 targeting .NET Framework 4.6.1.
Server: Windows Server 2012 R2 Standard 6.2.9200 with IIS 8.5.9600.
The story
We've created a blank MVC Web application using the default project templates provided in Visual Studio 2017.
The app is deployed following the official specification: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/.
The confusion arises mainly from these two points:
Running the app through command-line on Kestrel works.
Running a different app but targeting .NET Core 2.0 and publishing as framework-dependant works flawlessly on IIS.
But between these two apps: the codebase is the same, the IIS website and application pool is the same and we even emptied out the app directory and used the same one.
Due to these points the only difference seems to be the net461 app's executable file.
We do not have full control over the Windows Server where we're trying to deploy but we do have administrator accounts. The current assumption is that the issue lies within permissions - maybe AD group policies, antivirus blocking the file but we're still awaiting response from the client's sysadmins. Meanwhile we haven't been able to replicate the error code ‘0x80004005: 1’ while trying to setup these restrictions on our development machines.
Here's an incomplete list of ideas and points about the issue we've tried while problem solving:
The initial app (targeting net461) works flawlessly on IIS when
deployed to other servers (Windows 10 Enterprise, Windows Server 2012
R2 Datacenter).
Reinstalling different versions of ASP.NET Core/.NET Core: Runtime & Hosting Bundle.
Setting NTFS permissions to the dotnet folder.
Changing IIS application pool identity to an administrator account.
Restarting the server.
Going over local group and security policies.
Going over the antivirus settings and logs.
Trying to deploy on a brand new server (same OS, same bloat).
All ideas/comments are greatly appreciated. The more obscure the better.
EDIT:
Since this got flagged as a possible duplicate of ASP.NET Core 0x80004005 I need to specify why that is not a duplicate.
That referenced project is an older version of ASP.NET Core (last use
of project.json was in 2016)
That referenced project targets .NET Core and not .NET 4.6.1. It is mentioned here as well that targeting .NET Core works on IIS in regard to this issue.
Selected answer points out that they fixed it by:
Turns out that this was result of needing to install some windows
updates and this problem:
api-ms-win-crt-runtime-l1-1-0.dll is missing when opening Microsoft
Office file
Rather than install the version discussed in the above issue I whet
into Programs and Features and ran a repair on Microsoft Visual C++
2015 Redistributable.
but the installation of Microsoft Visual C++ 2015 Redistributable is one of the steps in the official setup guide and it is mentioned here as well that the official guide has been followed during the setup process.
We have gone over that post and tried to repair and reinstall the Microsoft Visual C++ 2015 Redistributable runtime components and this did not fix the issue.
If anyone stumbles upon this post in the future:
The problem was indeed in the server's antivirus. It wasn't directly blocking the app's executable but its call to a class library in the system folder. This termination did not raise any of the usual alarms.
The application "C:\inetpub\apps\AppFolder\App.exe" attempted to load the library "bcrypt.dll" by calling the function "LoadLibraryExW". The operation was blocked and the application terminated.
After switching the MVC blank app to a completely blank Hello-World app it ran successfully.

ASP .Net core project CI\CD fails in Publish using DevOps Project

We have an ASP.Net core 2.1 Devops project build and released successfully. But when we try accessing we are getting error.
HTTP Error 502.5 - Process Failure
If we take the drop from artifacts and try local it is working perfect. Please help!
After enabling stdoutLog, we got the following error details.
It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.1.0-preview1-final' was not found.
- Check application dependencies and target a framework version installed at:D:\Program Files (x86)\dotnet\ - Installing .NET Core prerequisites might help resolve this problem:http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
- The .NET Core framework and SDK can be installed from:https://aka.ms/dotnet-download - The following versions are installed:2.1.2 at [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Our application was using '2.1.0-preview1-final', seems Azure installed the latest version 2.1.2 for the DevOps environment. We updated our application with Core 2.1.2 and tried again. Now the application runs successfully without any error.
Thank you Martin Brandl!
Your best shot will be to enable logging to track down the error:
Go to the Kudu environment (https://YOURSITE.scm.azurewebsites.net)
On the top menu, select Debug console -> PowerShell
Navigate to site -> wwwroot and open the web.config
Set the stdoutLogEnabled attribute to true and save the file.
Create a folder named logs next to the web.config using mkdir logs
Now if you try to browse your site again, you should see a log file within the previously created directory containing additional information.
See also:
Determine whats wrong with your Azure Web / API App deployment

Asp.Net Core 2.0 on Azure results in a 502.5

I have a small web app developed with Asp.Net Core 1.1 deployed on Azure and it works well. I just migrated the project to use Asp.Net Core 2.0 and tried to deploy it on Azure. The deployment went fine but when I open the site, I get a 502.5 error. When I check my Azure log stream, I get the following error:
This error occurs when a CGI application does not return a valid set
of HTTP headers, or when a proxy or gateway was unable to send the
request to a parent gateway. You may need to get a network trace or
contact the proxy server administrator, if it is not a CGI problem.
Useless to say that it works well on my development machine with the same code. Note that I'm also using Entity Framework Core 2.0 although I deactivated the database creation on Azure (to check if it was not the cause).
For information, the way I migrated from 1.1 to 2.0 is by changing the target framework settings to "netcoreapp2.0" and by using the NuGet package "Microsoft.AspNetCore.All". Just to be sure, I also deleted my publish profile and recreate one.
Is it possible that Asp.Net Core 2.0 is not yet available on Azure ? I'm fairly new to Asp.Net Core, so I don't know when new releases are made available on Azure.
EDIT
When I try to run my app with dot net CLI via the debug console as proposed by natemcmaster, I got the following issue:
Unhandled Exception: System.IO.FileLoadException: Could not load file
or assembly 'Microsoft.AspNetCore.Hosting.Abstractions,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
I downloaded the DLL on my desktop and check the version with Dot Net Peak and indeed, the DLL is 1.1.2, although I created the project with Visual Studio and directly publish it, so is it an issue with Visual Studio ? Or Nuget ?
the issue was actually coming from the fact that, at first, my web app was using .net core 1.1, which deploys all the DLL in the "wwwroot" folder of the web application. However, with asp.net core 2.0, it does not do that anymore as the DLL are picked up from a global store. However, as Visual Studio does not clean the destination folder before a publish, I ended up with a situation where the 1.1 DLL were in my wwwroot, so the web site was picking up these ones instead of the 2.0 ones in the store folder.
This is explained in more details here: https://github.com/Azure/app-service-announcements-discussions/issues/2#issuecomment-313816550
Others have explained the reason why this is happening. I'd like to provide another – arguably easier – solution to the problem.
Just change the settings so that you remove files that are already on Azure – see below:
Check for log files either in the portal or by remotely accessing D:\home\LogFiles.
Sometimes, the logs won't indicate what is going wrong. Another good way to investigate further is to try launching your ASP.NET Core app from the Debug Console. If you are missing a shared framework version or there is another startup error, this will be more visible from the Debug Console.
Go to
https://(your web site name here).scm.azurewebsites.net/DebugConsole/
Your site will be in D:\home\site\wwwroot. You can launch it by executing:
cd D:\home\site\wwwroot
dotnet MyWebApp.dll
If you app still fails to launch, make sure that D:\home\site\wwwroot\web.config is available and configured to use ASP.NET Core Module. https://learn.microsoft.com/en-us/aspnet/core/hosting/aspnet-core-module
In my case, It was caused by having a space in the Project Name.
I can readily add a space, publish => 502.5.
Remove space, publish => good to go.
Hard to believe but I am duplicating it readily with above.
Also using "Remove Additional Files at Destination" per #Sam's Answer
See https://github.com/Azure/app-service-announcements/issues/14
"The rollout is expected to complete by Friday June 30th."
In my case the issue occurred because AppService at that time supported 2.0.0-preview2-006497 but I had 2.0.0-preview3-006890 installed which was used on build.
So I added global.json to use preview 2 SDK and it worked then
I don't know if this could help someone one day but in my case, I was using :
-Microsoft.AspNetCore.All 2.0.5
Downdrage to Microsoft.AspNetCore.All 2.0.3 resolve my problem
This happens when your version of ASP.NET Core cannot be matched on the server.
The simplest solution is to change your settings to deploy the app as self-contained, so it doesn't matter if Azure can match the framework version. Also, delete the files already on Azure, so you don't have issues when upgrading, as explained by #Sam.

Publish asp.net 5.0 project to IIS fails with: The runtime was not packaged with the application

I created a ASP.NET 5.0 Website Project.
I published the project to a folder on my pc.
I created in IIS a website pointing to the physical folder: wwwroot
When I go in IIS to "Browse website" and the Browser opens on localhost I see this error:
Unable to find the runtime directory 'C:\TGB.Published\TGB.Backend\wwwroot\..\approot\runtimes\dnx-coreclr-win-x64.1.0.0-beta5'.
Possible causes:
1. The runtime was not packaged with the application.
2. The packaged runtime architecture is different from the application pool architecture.
When I look in the published folder approot\runtimes there is the folder dnx-clr-win-x86.1.0.0-beta5 with content.
But I am confused why approot is mentioned under the wwwroot? As you see on my screenshot they are both on the same hierarchy. Why does it look for approot under wwwroot?
My Application Pool for the created Website in IIS is .NET 4.0.
I encountered this same error. For me the issue was with the Target DNX Version. I had the default option selected x86 and changing it to x64 solved it!
Check your application pool in IIS. If it does not have 32-Bit enabled then you need to publish in 64-Bit.

Resources