How do I deploy .NET Framework 4 using Active Directory deployment? - deployment

I know it's possible to deploy earlier versions of the .NET framework using AD deployment, for example: http://msdn.microsoft.com/en-us/library/cc160717.aspx.
How do it do this for .NET 4? I tried unpacking the standalone .NET 4 installer and deploying the netfx_Extended_x86.msi package. This didn't work. After a reboot the event log shows that it tried but it failed to install with a message saying to run setup.exe.

Didn't test it but look at this: How to deploy .NET 4.0 Framework

Related

dotnet build looking for GeneratedMSBuildEditorConfig.editorconfig file?

I'm trying to build a .NET 6 Xamarin iOS app using .NET CLI.
This question is a follow up of this one.
Now the problem is that after a while, the build fails with the following error:
#[error]CSC(0,0): Error CS2001: Source file '/Users/runner/work/1/s/TestApplication/obj/arm64/ReleaseiPhone/net6.0-ios16.0/ios-arm64/TestApplication.GeneratedMSBuildEditorConfig.editorconfig' could not be found.
AFAIK this file is used by Visual Studio and has nothing to do with the .NET CLI.
This seems to be the Roslyn compiler that looks for it.
/analyzerconfig:"obj/arm64/Release|iPhone/net6.0-ios16.0/ios-arm64/TestApplication.GeneratedMSBuildEditorConfig.editorconfig" /analyzerconfig:/Users/runner/hostedtoolcache/dotnet/sdk/6.0.402/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_6_default.editorconfig
EDIT:
/p:RunAnalyzersDuringBuild=false
does not help.
EDIT 2:
This seems to be a new behavior of a .NET 6 build. Originaly, my project is not .NET 6, it has been upgraded to it.

service fabric running .net 6.0 application

We are migrating our application from .NET 4.6.1 to .NET 6.0.
after deploying the migrated application, it is failing to find framework dlls. After logging into cluster VM looks like .NET 6.0 is not installed on machines. Do we have to have to separately install .NET 6 on cluster?
existing cluster is configured for auto fabric upgrade and current fabric version is 9.0.1028.9590
Thanks
You definitely don't need to install .NET frameworks on Service Fabric - this should be bundled as part of your Service Fabric application packages. We recently went through the exact process of upgrading our applications and I can also confirm that our cluster does not have any recent .NET frameworks installed.
How do you create your deployment packages? I suspect this may be the source of your problem...
For example, if using Azure DevOps, basically you need the following build tasks:
Use Net Core => to install 6.0.x SDK
Restore nuget packages
Build your .sln file via VS Studio build task
Build your .sfproj file via another VS Studio build task with parameters /t:Package /p:PackageLocation=$(build.artifactstagingdirectory)\applicationpackage
And publish artifact using source $(build.artifactstagingdirectory)
Finally, use the default powershell script Deploy-FabricApplication.ps1 that comes with default VS Studio to register and deploy your application to cluster.

ServerManager.exe -This application could not be started

I have problem on Windows Server 2019, all application which use .Net cannot be started. I have 4.8 version with all windows update. But I get this error. I tried reinstall, use fix tool for .NetFramework but i cannot fix .NetFramework
enter image description here
We just found this solution. (https://techcommunity.microsoft.com/t5/windows-server-for-it-pro/windows-server-2019-and-net-4-8/m-p/2660319)
I ran into this issue after the Windows Update, Cumulative Update for .NET Framework (KB5006765), was installed on a Windows Server 2019 that also had Azure AD Connect installed. Apparently, a bunch of .NET registry items where deleted. Server Manager and any software built on .NET was not working...throwing this error:
This application requires one of the following versions of the .NET Framework: v4.0.30319
Do you want to install this .NET Framework version now?
DSIM and SFC repairs did not work, nor did rolling back the Windows Update.
Found some insight here:
https://www.bleepingcomputer.com/forums/t/758800/net-48-kills-server-2019/
Ended up having to import these registry items from a working system:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\Default]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]
"AspNetEnforceViewStateMac"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\Default

failed to start process with commandline 'dotnet .\myapi.dll', ErrorCode = '0x80004005 : 80008096

I asked a question here on how to ensure the correct version of dotnet is included in the build.
How I am wondering whether the version is still not getting deployed.
What would I be looking for in the deployed files to tell?
Deployment does include the following files
52,816 dotnet-aspnet-codegenerator-design.dll
689,584 Microsoft.CodeAnalysis.CSharp.Workspaces.dll
2,624,944 Microsoft.CodeAnalysis.Workspaces.dll
23,632 Microsoft.VisualStudio.Web.CodeGeneration.Contracts.dll
73,296 Microsoft.VisualStudio.Web.CodeGeneration.Core.dll
35,408 Microsoft.VisualStudio.Web.CodeGeneration.dll
69,200 Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll
28,752 Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll
34,896 Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll
157,776 Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll
When I login to the machine the code is deployed on and type
dotnet .\myapi.dll
the error is
It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.1.5' was not found.
- Check application dependencies and target a framework version installed at:
C:\Program Files\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
Browsing to the site url gives
HTTP Error 502.5 - Process Failure
Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=808681
And the event log shows
failed to start process with commandline 'dotnet .\myapi.dll', ErrorCode = '0x80004005 : 80008096.
How do I ensure dotnet is deployed?
[Update]
I see that c:\program files\dotnet.exe is version 2.1.26919.1
However I have installed .Net Core Runtime 2.1.5 (x64)
I can tell that it is installed because when I re-run the installer it asks whether I want to repair or uninstall.
I suppose that since the api is running under IIS it does not need dotnet.exe ?
The machine is running Windows 2012 Server R2
Just posting this in case it helps someone. I was hitting this exact error attempting to deploy a regular .Net site using ASP.Net Core on IIS. In my case .Net was installed, but my site was throwing a 500 Internal server error and in the Event log I was showing "failed to start process with commandline 'dotnet .\myapi.dll'". It ended up being my web.config file, which Visual Studio had the line starting like:
<aspNetCore processPath="dotnet" arguments=".\myapi.dll"
This ended up being the problem, this is how you would launch a .Net Core site. But I was targeting regular .Net. So my web.config needed to be:
<aspNetCore processPath=".\myapi.exe" arguments=".\myapi.dll"
Before finding this I had attempted to install .Net Core runtimes, and SDK, both of those ended up morphing the error into a 500.19 Internal Server Error with error code 0x8007000d. This indicated a malformed XML in my web.config or AppHost (IIS). Neither of those files had XML syntax issues. This particular error was caused from having removed the .Net Core Hosting Bundle. You need to have the hosting bundle installed for your server to recognize the "aspNetCore" tag. Once the hosting bundle was installed and the web.config change made I was running.
Hope that helps someone. This was the first search result I hit beginning to debug.
When I ran
dotnet run .\myapi.dll
I got
Did you mean to run dotnet SDK commands?
Please install dotnet SDK from: go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
when I went to the URL it installed SDK 2.1.403
which worked.
I had to "Repair" .Net Core 2.1 Windows Server Hosting to get rid of this error.

Add .NET 2.0 SP1 as a prerequisite for deployment project

I have a .NET 2.0 application that has recently had contributions that are Service Pack 1 dependent. The deployment project has detected .NET 2.0 as a prerequisite, but NOT SP1. How do I include SP1 as a dependency/prerequisite in my deployment project?
You'll want to setup launch condition in your deployment project to make sure version 2.0 SP1 is installed. You'll want to set a requirement based off the MsiNetAssemblySupport variable, tied to the version number of .NET 2.0 SP1 (2.0.50727.1433 and above according to this page.)
Bootstrapping the project to actually download the framework if it isn't installed is a different matter, and there are plenty of articles out there on how to do that.