Im having truble with publish and deploying a .net core web-api on a ubuntu 16.04 desktop ran in vmware. I have developed a simple web-api application with almost no extra implementation from the template v1.1. I have been installing and using some dependencies that are runnable in .net core.
Problem:
Im using framework dependent release v1.1.
I can launch a released version on windows by using "dotnet publish -c release" and it works fine. I then move the published files to my ubuntu machine and tries to run it I get the error that it cannot locate some kind of assembly that I know is in the dll folder.
However if I move the source code and project to my ubuntu machine and do a "dotnet restore" and "dotnet publish -c release" the application works. If I dont use the "dotnet restore" and tries to publish on my ubuntu machine it gets another "are you missing an assembly reference".
My guess is that when I do "dotnet publish -c release" it targets runtimes only for windows or ubuntu depending on the machine publishing.
Im grateful for help and explanation for this.
Sorry for bad language.
Stupid me have been running the wrong application dll. I always ran the application dll in the folder netcoreapp1.1 when I should have ran the same dll in the sub directory publish.
Related
For an appcenter deployment I want to use SonarQube to analyze the code quality of the project. I have setup the appcenter-pre-build.sh and appcenter-post-build.sh scripts to install and enable Sonarscanner in the appcenter build process.
Now when I build for iOS, the build process fails, because it cannot find 2 files in the /Users/runner/work/1/.sonarqube folder on the build machine. Those files are /Users/runner/work/1/.sonarqube/conf/cs/SonarLint.xml and /Users/runner/work/1/.sonarqube/conf/4/ProjectOutFolderPath.txt.
I know for a fact that the /Users/runner/work/1/.sonarqube/conf/cs/SonarLint.xml is there, because in the logfile it says: "Writing Roslyn analyzer additional file to /Users/runner/work/1/.sonarqube/conf/cs/SonarLint.xml..." when running the appcenter-pre-build.sh script, which installs the sonarscanner.
I am installing the sonarscanner with the command: dotnet tool install --global dotnet-sonarscanner and the version that gets installed is 5.0.4.
On my SonarQube server I am running version 8.3 community edition and when the appcenter build runs, the analysis report appears in my project on my sonarqube server.
The build however fails.
Please advice on how to get the iOS builds in appcenter to succeed while sonarscanner is enabled.
Thank you in advance.
The problem is how appcenter logs the build process. From going through the logfiles, you get the impression that the build fails, because of the integration with Sonarqube.
The build failed however, because there were some context links missing in the c# code. Once this issue was found by building locally, The builds succeeded.
I am working on a release pipeline that should deploy our project artifacts and run tests over them.
The agent is on a Ubuntu machine.
So far I couldn't find a way to run tests over Ubuntu because as microsoft docs say we should install either the Visual Studio or Visual Studio Test Platform using an installer task on the agent.
The problem is neither of them are available on a linux OS , so I am a bit stuck here wondering if there is a third option that we can use to run our tests on this agent.
It depends on what type of your project is. If your project is .net core, you can try dotnet core cli task. Dotnet test can cross OS. If your project is .net fx, it cannot run on linux.
Run dotnet test command in .Net Core task
If you are using deployment group , you can run dotnet test command in a bash task and then use a Publish Test Result task to retrun trx files that Test has generated.
I am trying to upgrade an Asp.net core application on Debian vm. After I copy the new dlls and test with dotnet path-to-my-app.dll I get this error.
LTTng-UST: Error (-17) while registering tracepoint probe. Duplicate registration of tracepoint probes having the same name is not allowed.
Two further clarify, I am upgrading a self contained app. I first stop the running service and then replace the files with new ones and then just do a
dotnet path-to-myapp.dll
and the above error appears. There was no change in appsettings or any other configuration changes. Do I need to stop any other services as well?
For the general public here is the issue and the solution:
The version on my linux VM was 2.1.5 and my App target version was 2.1.0, However the previous target framework version of installed app was 2.1.0 and it was working fine. I only made a few changes and went on to deploy the new version, first it failed to build with the command "dotnet build --runtime linux-x64" complaining about different frameworks to restore and build. So I first changed the project file to use
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
And after that it failed to run with the above error. Finally I changed the RuntimeFrameworkVersion to 2.1.5 to match my host version AND didn't use the "dotnet build --runtime linux-x64" command but Publish instead. I also read about using the Publish command here:
https://codeblog.dotsandbrackets.com/package-downgrade-issue/
I have just setup up IIS 10 on a clean Server 2016 hosted server, and installed the following packages that I have gleaned should be on the machine to allow IIS to host ASP.NET Core applications:
aspnetcore-runtime-2.1.0-win-x64.exe
dotnet-hosting-2.1.0-win.exe
dotnet-runtime-2.1.0-win-x64.exe
I have installed my app straight into the Default Web Site and replaced all files in C:\inetpub\wwwroot\ with my app files. I also did assign the web site an app pool with no managed code, so that isn't my problem.
Last time my app was built with 2.0, and I installed the latest versions of the above packages, which I'm sure was 2.0, and the only error I had was that the command dotnet that IIS uses to invoke Kestrel to run the site, was not in the PATH env. variable
Now when I try and browse to localhost on the Server 2016 machine, it gives me the following error, found in the Windows event log:
Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE' with physical
root 'C:\inetpub\wwwroot\' failed to start process with commandline
'dotnet .\QuickDrive.Mvc.dll', ErrorCode = '0x80004005 : 8000808c.
Initially I tried with the same build as before, which was 2.0, and when I got this error, I rebuilt the app to target 2.1. Nearly every search result and relevant SO answer I can find suggest a version conflict, but now there should at least be no version conflict between the runtime and hosting package on the server. Maybe there are other version conflicts I am not aware of though?
At very least I'm asking for some advice on how to get more detailed diagnostic information, even if I don't get an answer that tells me straight what config options and versions to check on Windows and on IIS.
You have to install the Core SDK for whatever version you want to target in Visual Studio. Installing the runtime alone won't do the trick. You may have the restart Visual Studio afterward to see it in the list.
Here is a link to the SDK 2.1 download (the latest as of this writing).
I solved the problem by running dotnet myWesite.dll in PowerShell, and first I found that dotnet.exe was not in the PATH environment variable, and after fixing that, running dotnet myWesite.dll again gave me a meaningful error message that an assembly was missing because it had not been included when I published the website.
I faced the same error on the dev machine in IIS Express. MVC App stopped working all of the sudden. Eventlog gave the 0x80004005 error code.
After trying multiple suggestions, the solution to debug the wired error code was to run the app in the console:
[Project bin folder]> dotnet [projectname].dll
It appeared that during the NuGet package update, the dotnet core version was accidentally updated to 2.1.4 where as the installed version was 2.1.3
[could be a bug in Nuget manager as the update was from there]
I edited the project file to reference the available version (2.1.3) and the app started to work properly.
I have created a new ASP.NET Core Web Application. I'm using TFS (2015 Update 2) MS Build process to build and deploy my application to my Dev/QA server. I'm running my code with a Kesrel/IIS configuration on a window server.
My build Steps are:
Command Line: dotnet Restore -- restores my nuget packages
Command Line: dotnet build -c Dev -- builds my dev profile
Command Line: dotnet publish --framework netcoreapp1.1 --runtime win7-x64 --output "C:_work\dev\svc" --configuration DEV --no-build
Publish Build Artifacts: from that output folder in step 3 to my web server.
Problem:
The major problem I have is that the new core applications all run as console applications, so there is an 'xxx.exe' file running, in addition to the w3svc.exe IIS app running. When my Publish Build Artifacts steps runs, the process fails because the 'xxx.exe' file is in use, and cannot be modified.
So far as I can tell, you have to use the "dotnet" CLI to build and publish your CORE applications, and you cannot use the VS Build steps.
I've tried pointing my "dotnet publish" command to directly to the web server, but that has the same problem. You can see in my "dotnet publish" command I'm indicating a configuration to use (DEV). However even if I have DEV setup in VS to do a webdeploy, the "dotnet publish" command ignores that and either puts the code in a default publish location, or the location I specified in the command. So that doesn't work like the old .net framework did either.
My hosting team won't give me access to run remote powershell scripts to stop the IIS apps and console application, and I don't see any other build steps that would work to build the CORE application.
I'm on TFS 2015 Update 2. We're soon going to be on Update 3, but I don't know if that will give me feature to fix this either. If anyone know, I'd love to hear it!!
If I stop IIS app pools and make sure the console app is also stopped, my Build and Deploy steps above, work perfectly, but I don't want to have to manually stop IIS app pools every time before a build.
ASP.NET Core still respects the presence of an app_offline.htm file, so if you can copy a file with that name to the app destination on your server before step 4, and remove the file after step 4, the deployment should work. The ASP.NET Core module watches for this file and shuts down the hosting process (the .exe).
I'm sure you can run msdeploy tasks from VSTS, and msdeploy has a parameter to create an app_offline.htm file for you (although there is currently a bug in the ASP.NET Core module deployed to Azure where the file has to be all lower case letters). Msdeploy does work in deploying a published Core application to IIS.
Since stopping IIS app pools can solve the issue, you may try to install IIS Utilities to stop or start Application pool.