I installed VS 2017 along with .NET Core SDK on Windows 10. But it did not install ASPNETCoreModule as shown in figure 2 below. I thought .NET Core SDK should have installed it implicitly - and one does not have to install it separately. NOTE: I'm trying to publish my asp.net core app to IIS and the publish process requires ASPNETCoreModule as explained in the above link and also in this official MSDN article.
ASPNETCoreModule is missing:
ASP.NET Core Module is installed separately from the SDK. You can download the current version 2.0.0 here. https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-download.md#windows-server-hosting
See https://github.com/dotnet/core/blob/master/release-notes/download-archive.md for a list of other releases.
ASP.NET Core Module is installed separately from the SDK
It's not true since the release of 2.1. I'm experiencing the same issue on Windows Server 2016. The module was installed on developer PC after uninstalling old versions / installing 2.1 a few times, but still struggling with the same issue in 2016. %SystemRoot%\system32\inetsrv\aspnetcore.dll is still missing.
In order to run .net core apps on IIS you need to have installed the ASP.NET Core Module ( the way it works is explained here ) that comes:
1 - with the SDK 2.1,
2 - With the Hosting Bundle Installer that bundles the .Net Core and the ASP.NET Core Runtime into a single bundler.
you can have both from the download page
If you are a developer computer you already have the Module with the SDK, I think is better to have on Sever computer only the hosting bundle
First, you need to check your IIS configurations, in case Shared configuration is configured in your IIS then normal installation of dotnet hosting bundle package wont work,
to make it work you need to install bundle package by command line with the argument as below:
dotnet-hosting-{VERSION}.exe OPT_NO_SHARED_CONFIG_CHECK=1
you can refer ASP.NET Core Module with an IIS Shared Configuration
This solution work for me because we are using the shared configuration in IIS
Related
How can I fix deployment problem? upgraded entity framework core from 3.1.4 to 3.1.5. Result mvc core web app runs in VS, but fails in Azure.
Dot Net core 3.1 with EF 3.1.4 in Azure ran OK.
I updated the Nuget EF packages to current stable 3.1.5, and the result runs locally, but fails when deployed to Azure with message:
"could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=3.1.5.0"
I used the Azure AppService Console and can see the EF versions have the same date as my local files "5/1/2020".
The FileExplorer details screen shows the version as 3.1.5, while the error message says it can not load 3.1.5.0. I searched, but did not find any other people with this problem.
I think is missing the reference there. If you can, check in the folder "packages" if there is a EF 3.1.5 there. Also, check if there is some places which is showing just 3.1.5.0 and try to change to 3.1.5 as is showing in the nuget library.
Finally solved the problem. It involved information from this Microsoft article:
https://learn.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-3.1#clear-package-caches
Needed to uninstall some nuget packages, use command line nuget commands to clear nuget cache, and then re-install latest nuget packages. Redeployed to Azure and the site works again.
Situation
Today there is a security vulnerability in .NET Core 2.1 and we have all of our developers update their .NET Core 2.1.x to .NET Core 2.1.10 but no idea when we'll get around to updating the .NET Core hosting bundles on our production web servers.
Questions
Does the fact that we updated our developer machines become nullified because we haven't updated the web servers yet?
Once our developer's code is pushed to production will those apps run against the older libraries for .NET Core that are on our web servers or will they somehow run in the newer version that our developer machines are building with?
If our projects once pushed to production run under an older version of .NET Core libraries, will we run into compatiblity issues because our developers built against an older version?
I guess my ultimate question is, should we always have a policy in our company to update the hosting bundles on our web servers before we update our development machines?
If you wanna benefit from the update done from .NET Core 2.1.x to .NET Core 2.1.10, I would say : while you don't update the servers, yes.
The apps will try to run under the installed framework on the ervers. If you are publishing using the default mode, your code will depend on the framework installed on your production machines. However, you can change to self contained deployment mode and embed the framework with your code to work on "targeted platform" (https://www.danielcrabtree.com/blog/496/net-core-self-contained-and-framework-dependent-deployments-explained).
It should remain compatible because the versions are both 2.1.x. However I would not try it in production before having tested it in a separated environment.
I believe you should not update your production servers before having tested the new version first. I would change the targeted framework on my development machine, then I would update the framework and the code in (at least) a pre-prod environment. I would test it in this environment. And only then, I would consider a change on the production servers.
Point 3. EDITED based on Daboul comment
Whenever i try to run/debug an Azure Function project in Visual Studio 2017 i get an error stating that i need .Net Framework 4.7.1 (which i can't install due to have preinstalled windows 10 Enterprise in my working machine by company policy),I'm using Azure Functions and Web Tools Extension version 15.0.40608.0, anyone can help me with a workaround on this matter ?
If you got exactly this error message
The reference assemblies for framework ".NETFramework,Version=v4.7.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. ...
You can try to change your target framework to a version you have installed, like the error suggests.
Right click on your project, Edit FunctionProjectName.csproj, find <TargetFramework>net471</TargetFramework>, change it to the version installed, like net461.
If you can't run this project correctly on lower version of .Net Framework, as rickvdbosch says, it might be required to update your Windows and install the SDK or modify your code to make it compatible on lower version.
I am developing a Web Application with ASPNET Core 2.0 on Visual Studio Code on Linux. But the host I'm trying to deploy the application is a Windows Server and the only target available option is .Net Framework 4.6.
So, when I try to run dotnet publish -o /folder -f net461 it shows me
this error.
Is it possible to develop an aspnet core application on linux and deploy it on windows using .Net Framework?
The following is the text of the error:
/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1122,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/home/maransatto/Projects/FATEC/EraDoConhecimento/web/BDAg.csproj]
There are 2 scenarios: ASP.Net Core with .Net framework and ASP.Net Core with .Net Core. You can't develop asp.net core with .net framework on linux, so probably your application's target is "netcoreapp2.0" (suposed you downloaded the latest version). It's ok you deploy your app on windows server just using .net core runtime 2.0.
your command should be
dotnet publish -c Release -f netcoreapp2.0
You can deploy Framework-dependent or self-contained version. See (https://learn.microsoft.com/en-us/dotnet/core/deploying/index).
You also need Asp.Net Core Module on windows with IIS Integration.
https://learn.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x
When publishing self-contained you don't need .net core to be installed on the server.
I am stuck on creating azure batch pool with .net 4.6.1.
I went through those very good resources:
Compute Node - Install .NET 4.6.1
How to get the Windows 2016 Preview OS
and I found out that there is a way to use .net 4.6.1 without installing it manually on a node. There is a programmatic way to set up Windows Ghost image with the latest .net version which is .net 4.6.1 but my node is defined in advance.
I need to have .net 4.6.1 because we use Data Factory and custom activities which are run on azure batch nodes. We upgraded .net version manually on that node but Microsoft doesn't guarantee that the state will preserve and we noticed a few times that node was reset to its original state.
My questions are:
do you know if there is any way on azure portal to choose OS family set to Windows Server 2016 with installed .net 4.6.1 version already?
does anybody know when there will be any os with .net 4.6.1 available?
or should I go with StartTask feature and try to install .net 4.6.1 manually? However, that option sounds like some workaround and not the correct solution.
There is not. They have said that when server 2016 releases on azure, it will be available on batch. Until then, the 4.6.1 install as a startup task is your only option. They also will, at some point, allow us to use custom images, rather than their pre-made images.
Updated 2016-02-07:
You can now deploy OS Family 5 under Cloud Services Configuration in Azure Batch, which is equivalent to Windows Server 2016 (as Marketplace/VM image).
Previous answer:
Answers to your questions:
do you know if there is any way on azure portal to choose OS family set to Windows Server 2016 with installed .net 4.6.1 version already?
Yes, you can change the "Image Type" to Marketplace and select 2016-Datacenter which is Windows Server 2016.
does anybody know when there will be any os with .net 4.6.1 available?
As per above, it's available now for Marketplace (IaaS) under 2016-Datacenter. The Batch team is currently working to support OS Family 5 as a guest OS for Cloud Services.
or should I go with StartTask feature and try to install .net 4.6.1 manually? However, that option sounds like some workaround and not the correct solution.
You can always install it as part of a start task and is considered the proper solution for Azure Batch proper for compute nodes with Windows Server < 2016.
You will still have to use the StartTask to install .NET 4.6.1. In the first resource you mentioned, there's a small piece of code that checks the current .NET installation and installs+reboots if needed.
If possible, downgrade your application's .NET version to 4.5.2 to save the hassle of restarting the node.