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

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.

Related

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

Server Manager not available/accessible after removing .Net feature in widows server 2019

I have removed .Net Framework feature from "Server Manager -> Remove Roles and features Wizard".
(This image is from a different server)
Later I noticed that this activity has affected many windows features (Server manager, IIS Manager, Turn on off windows features etc..).
After removed .Net Framework feature I was not able to find the Server Manager application.
I tried answer in this link and able to restore ServerManager.exe but once I try to load the server manager it's giving below error,
I may be able to resolve this if I can re enable .Net frame work feature. But not sure how to do that without using server manager(since I cannot open sever manager).
Appreciate any solutions or suggestions regarding this.
Finally able to re enable .Net feature and access server manager by following below steps,
Open command prompt
Run the command: dism /online /enable-feature /featurename:NetFx4ServerFeatures /ALL and press return.
Type PowerShell and press enter.
Run the command: Install-WindowsFeature PowerShellRoot,PowerShell,PowerShell-ISE.
Restart the server.
Credit belongs to this blogger:
https://glennopedia.com/2020/02/14/why-you-shouldnt-remove-net-in-windows-server/
This kind of errors are caused due to lack of .NET framework on your machine or if you installed old version of framework. You need to install an appropriate .NET Framework on your computer.
Updating .NET framework on your computer will solve your problem maximum.
Install it from the Microsoft website.
Run as Administrator , the server manager will open.
Now you can try to add.

CI Build Error with Visual Studio Test step after .Net 4.6 upgrade - Executor process exited; There was no endpoint listening at net.pipe

I just upgraded all of the projects in my solution to point to .Net 4.6 (There is a web app, some class libraries, a database project, etc.). I have a CI build set up in Visual Studio Team Services (using the new build system, not XAML) which was building successfully prior to the upgrade. This build definition runs Debug, Staging, and Production builds and the build definition is comprised of two steps:
Visual Studio Build
Visual Studio Test
Prior to this framework upgrade, everything was building fine. I upgraded and built everything locally and it all worked great too. I could run the tests and got green across the board. Now, when I checked my code in it kicked off the CI build, and I got the following error/s on the "Visual Studio Test" step (taken from the logs):
2015-09-18T19:08:02.1212067Z Microsoft (R) Test Execution Command Line Tool Version 14.0.23107.0
2015-09-18T19:08:02.1489666Z Copyright (c) Microsoft Corporation. All rights reserved.
2015-09-18T19:08:02.8906952Z Starting test execution, please wait...
2015-09-18T19:08:03.3713251Z Warning: Using Isolation mode to run tests as required by effective Platform:X86 and .Net Framework:Framework35 settings for test run. Use the /inIsolation parameter to suppress this warning.
2015-09-18T19:08:07.4457804Z ##[error]Error: Executor process exited.
2015-09-18T19:08:07.4457804Z ##[error]
2015-09-18T19:08:07.4557251Z ##[error]Error: There was no endpoint listening at net.pipe:[...redacted...] that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
2015-09-18T19:08:07.4557251Z ##[error]
2015-09-18T19:08:07.7730938Z ##[error]VSTest Test Run failed with exit code: 1
2015-09-18T19:08:07.8043435Z ##[warning]No results found to publish.
The Visual Studio Build passes for all three configurations, and the Test step only fails for Debug because it cannot find any tests for the other two configurations. Additionally, my builds are running off of an Azure VM that I stood up to act as a build server, and when I run the CI build using the Hosted build controller the Test step passes, because it cannot find any tests to execute, but the warning about using 'Isolation mode to run tests...' is still printed out in the log.
Is this a known issue? Has anyone else encountered this after a 4.6 upgrade or in another context in VSTS?
Edit: the .Net Framework 4.6 SDK and targeting pack/s ARE installed on the build machine:
The first warning suggests that the tests are running on .NET 3.5:Warning: ... effective Platform:X86 and .Net Framework:Framework35 ...
So I explicitly set the vstest.console framework version to 4.5. (At this time 4.6 is not an available option). That resolved these symptoms for me.
To do so edit the Visual Studio Test build step. On the Build tab of the step settings, expand the Advanced section, and set Other console options to /Framework:Framework45.
I found a workaround for the time being that works for now. I modified the settings for the Visual Studio Test build step as follows:
On the Build tab of the step settings, expand the "Advanced" section, and change the VSTest version to "Visual Studio 2013".
That's all it took for me. I tried this because my build was working when I switched to the Hosted build controller, and this was one of the differences between the two in the logs. This is the only thing that I changed, and it worked. I have no idea WHY the Visual Studio 2015 VSTest version doesn't work, but will look into it more and add to this if I find anything...
I experienced this error (specifically the VSTest exit code) after upgrading a test project to 4.6.1. The issue was that the packages.config didn't update the test framework runner pacakge correctly leaving it at .Net 3.5. Updating the target framework resolved the problem.
After installing .Net Framework 3.5 feature everything was OK! See "cottsay" comment at https://github.com/Microsoft/vsts-tasks/issues/572

C# application .Net 2.0 Couldn't run in Windows XP

I built a .Net 2.0 Application for Windows XP but I made it in Windows 7.
The application contains a Mysql.data connection and CrystalReport. When I try to run it on Windows XP, the application does not run, giving an error message of:
The application failed to initialize properly (0xc000007b).
I tried to rebuild application in Windows XP, but when I rebuilt and ran it in Visual Studio, the following error occurs:
Could not load file or assembly or one of its dependencies. The module was expected to contain an assembly manifest.
How can I fix this?
Please try the following:
1.Uninstall the .NET Framework 3.5 from Add/Remove Programs (in the Control Panel) on Windows XP or Programs and Features on Windows Vista/Windows 7.
Even if the uninstall fails, go on to step 2.
2.After the Framework 3.5 has been uninstalled or if it failed, download and run the .NET Framework removal tool.
Here's the link to Aaron Stebner's Framework Removal tool on Windows Live Skydrive:
http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog_Tools/dotnetfx_cleanup_tool.zip?wa=wsignin1.0&sa=17797669
Aaron Stebner is a Microsoft employee. The tool he's developed is linked on that page and makes easy work of cleaning up damaged .NET Frameworks from your system so they can be reinstalled. When you run the tool, choose the .NET Framework 3.5 from the list and choose to cleanup. After this is done, reinstall the .NET Framework 3.5 that Design 3 needs by running the Expression Design 3 setup package again. It will detect that the .NET Framework 3.5 is missing and reinstall it for you. After that's done, try running Design 3 again.
3.If that still fails to resolve the problem, go to START, RUN and type CMD to run a command prompt. Type CHKDSK /R and hit ENTER. Hit the letter Y and restart the machine. Allow the machine to do the check disk scan. After this is done and it goes back into Windows, try Expression Design again.
more information here

How change IIS Express runtime from 4.0 to 2.0?

I'm trying to run using SharpDevelop a MVC2 web app. When I try to run the application, the following error show up in the browser:
Config Error There is a duplicate
'system.web.extensions/scripting/scriptResourceHandler' section
defined
and ...
If you see the text "There is a duplicate
'system.web.extensions/scripting/scriptResourceHandler' section
defined", this error is because you are running a .NET Framework
3.5-based application in .NET Framework 4. If you are running WebMatrix, to resolve this problem, go to the Settings node to set the
.NET Framework version to ".NET 2". You can also remove the extra
sections from the web.config file.
I'm on Windows 7 and have installed WebMatrix but can't figure out how to do what the error message tell me:
set the .NET Framework version to ".NET 2"
How can I change that config to avoid the error?
Here is the command:
appcmd set app /app.name:APPLICATION_NAME/ /applicationPool:Clr2IntegratedAppPool
More info about the command here
Remember change to the right(you could have more than one IIS installed) IIS directory before execute the command,
C:\Program Files\IIS Express
in my case.