57 questions
0
votes
2
answers
206
views
AzureDevOps pipeline: Two DotNetCLI 'restore' commands with different config
I'm trying to set up an ADO pipeline that does the following:
Attempts a dotnet restore using only our approved and verified package feed
If that fails, attempts a dotnet restore using public feeds
...
0
votes
1
answer
62
views
AddUserSecrets not working when running migrations
Setup for development on local machine:
ASPNETCORE_ENVIRONMENT is set to Local (so that appsettings.local.json is used for non sensitive configs)
We use user secrets to assist with secrets (inside ...
0
votes
1
answer
568
views
dotnet publish for ASP.NET Core MVC doesn't correctly handle wwwroot folder
I have a simple github actions deployments:
build:
..
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up .NET Core
uses: actions/...
1
vote
1
answer
759
views
NU1100: Unable to resolve Azure DevOps nuget package
We have an Azure DevOps nuget package that another service which is a net api uses without a problem. However, when this package is added to the worker service, pr pipeline fails at the "Restore ...
0
votes
1
answer
484
views
AzureDevOps dotnetcorecli does not build solution's class libraries and incorrectly looks for them in Artifacts
I have a simple .NET solution like below:
My Solution
ClassLibA
ClassLibB
MyAspNetCoreApp
In AzureDevOps pipeline I have also created a simple and straightforward pipeline:
trigger:
- master
...
1
vote
1
answer
478
views
WebView2 blank page when publishing WinUI3 app through DevOps pipeline due to 32-bit DLL file being included
I have created a WinUI3 application that uses the Microsoft.Web.WebView2 package (version 1.0.2045.28). When I build or publish the app locally from Visual Studio the app works as expected. When I ...
0
votes
0
answers
123
views
Azure Pipelines DotNetCoreCLI error for not finding the file
I am following a youtube tutorial and so far everything was great, tutorial uses Visual studio and I am using vs code
I am totally new to this and this is my first project. I've tried ms build, ...
-2
votes
1
answer
102
views
Managed pointers in .NET 6+
I'm trying to port an existing c++ library to .net 6. I have set the framework version and CLR support flag:
<TargetFramework>net6.0</TargetFramework>
...
<CLRSupport>NetCore</...
2
votes
0
answers
71
views
What is the difference in publishing dotnet apps for ubuntu using specific ubuntu RIDs instead of non-distribution specific linux-x64?
What difference does it make, if any, publishing a dotnet application for ubuntu using, say,
dotnet publish [...] -r ubuntu.20.04
instead of
dotnet publish [...] -r linux-x64
Performance tweaks, ...
3
votes
0
answers
1k
views
DotNetCoreCLI@2 Restore failing on all solutions today
Starting today, all 28 of our Azure DevOps hosted .Net builds are failing on the nuget restore task.
task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: |
$(BuildParameters....
0
votes
1
answer
765
views
kubernetes pod unable to connect to external database
I have an external postgres database (using digital ocean); I am able to connect to it from my laptop but I get a connection timeout from my minikube kubernetes pod.
This is in dotnet core (not sure ...
0
votes
1
answer
360
views
Filter in DotNetCoreCLI task is not working properly
I have a strange problem with DotNetCoreCLI@2 task. I am trying to add filter in the arguments, so only specific tests can run. I am using xUnit and Trait attribute for the goal.
[Trait("Category&...
0
votes
1
answer
4k
views
How do I run the DotNetCoreCLI@2 task to see verbose output for the build
I know there are outright verbosityRestore and verbosityPack inputs.. but what about for the regular 'build' of a .csproj file?
I've tried to find the answer in the documentation. I'm a bit frustrated,...
0
votes
1
answer
289
views
Entity Framework, Linq query is throwing exception "could not be translated. Either rewrite the query in a form that can be translated
I am building a platform on the blazer server, Dotnet core. I am using the code-first approach in EF core using repository patterns. The problem is there are messages in the database. I have an array ...
0
votes
1
answer
953
views
How to fix vulnerabilities found in DevOps container scans when they appear to come from dotnet-core runtime config files and not my actual project?
So when running a Trivy container scan on my dockerised dotnet 6 app during my devops pipeline, many times I discover critical vulnerabilities which break the build and I am not sure how to fix as ...
0
votes
1
answer
400
views
dotnet entity frameworkcore migration command not work in vs 2022
While migration in ef core using below command give me an error.
dotnet tool install --global dotnet-ef
After refer this link , i have executed below command.
dotnet tool install --global dotnet-ef
...
3
votes
1
answer
2k
views
How to run an Azure Pipeline DotNetCoreCLI task on Linux with permissions?
I have the following azure pipeline task snippet below, running on Linux self hosted agents.
- task: DotNetCoreCLI@2
displayName: Run Dotnet Test
inputs:
command: test
#...
1
vote
2
answers
2k
views
ASP.NET CORE web application doesn't use .css styles when run using dotnet command
I have a ASP .NET CORE application, targeted in verion 6.0.
When I run it from Visual Studio it looks great, but when I run it using dotnet command:
dotnet webApplication1.dll
it looks like no .css ...
0
votes
0
answers
2k
views
C# .Net Core 6 - Segmentation fault (core dumped) on linux fedora
I have a compiled succesfuly a .Net core dll, on a win10 machine and a fedora 35 both with .Net core 6 sdk, from
https://github.com/MindFlavor/prometheus_sql_server_exporter
On win10, it runs ...
0
votes
1
answer
137
views
EF Core CLI Migration Database Update Flow
May I know how does the actual flow look like when performing migration using the command below?
dotnet-ef database update --project MyModel --startup-project MyProject --context DBContext --...
0
votes
1
answer
850
views
How to transform Include attribute value of PackageReference property in .csproj using Package.props file?
In my solution I'm using Package.props file for settings versions for referenced packages.
For instance if I want to add a nuget package Microsoft.Cool.Package to one of my solution's projects, I just ...
3
votes
1
answer
2k
views
dotnet test /p option not supported when using a dll path
I have a dotnet core project that I have already compiled:
> dotnet build --configuration Release
If I try to run the test using the resulting dll using the /p option, it fails:
> dotnet test .\...
0
votes
1
answer
2k
views
DOTNETCORECLI@2 Publish succeeds but no artifacts
I have a legacy project and want to get into Azure Devops pipelines. I have a build pipeline setup and build seems to succeed. I've added a DotnetcoreCli Publish task and this succeeds but I never ...
10
votes
4
answers
20k
views
How to fix "Segmentation fault (core dumped)" when creating new dotnet project?
I am following https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/create
When I try to create a project, I get the following:
oskar@oskarslaptop:~/Programming/Resorvoir-CLI$ dotnet new ...
4
votes
1
answer
5k
views
Azure devops build pipeline seems to restore nuget packages twice
I have a build pipeline, where I have a Nuget restore step using NuGetCommand which works fine.
But the next step where the build is performed fails on missing nuget packages.
It seems the build step ...
2
votes
0
answers
443
views
Azure Pipeline - launch server inside test application
I have a XUnit project, that when starting up initializes a server in the class constructor:
public OPCUASampleServerTest(OPCTagList oPCTagList)
{
MySampleServer server = new(true, 3600, null);
...
2
votes
4
answers
2k
views
How to fail AzureDevops pipeline when test files are not found
I have the following DotNet Test task in my pipeline
displayName: 'unit tests'
inputs:
command: test
projects: '**/*Unit*.csproj'
...
0
votes
1
answer
111
views
Powershell 7: How to read from a file and add dotnet packages
I am new to Powershell 7
I have a .txt log file formatted like this:
Include
Version
Microsoft.ApplicationInsights
2.17.0
NewtonSoft.Json
13.0.1
I need to iterate and read the package names and ...
4
votes
2
answers
2k
views
How can I break the build with dotnet list --deprecated in a Azure Pipeline
I want to check my solution for the use of deprecated NuGet-Packages.
So I added
- task: dotNetCoreCLI@2
name: checkDeprecatedNuGet
inputs:
command: 'custom'
projects: '**/*.sln'
...
10
votes
1
answer
15k
views
How to specify an API Key when publishing to a private nuget source in Azure Devops?
I am trying to publish a NuGet package to a NuGet feed I created in Azure Devops. I have experience in doing these kind of things (I published on NuGet.org) but for some reason I do not understand, it ...
0
votes
1
answer
2k
views
Add Package to dotnet core project at build time Azure Pipelines
I am setting up an Azure Build pipeline to automatically build when a NuGet package get's published. In that build definition - I want to install the latest version of the package.
According to this ...
3
votes
1
answer
5k
views
Can DotNetCoreCLI build solution?
I have tried in my azure build pipeline to set a DotNetCoreCLI build task to build a solution but I just get an error:
MSBUILD : error MSB1011: Specify which project or solution file to use
because ...
10
votes
1
answer
9k
views
Retrieving project version from csproj in Azure Pipeline .NET Core CLI task
I have the following tasks in my yaml file in Azure DevOps
It publishes my console application and zip it in a file
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: ...
9
votes
2
answers
20k
views
Azure CI Pipeline - DotNetCoreCLI@2 Task error
I developed WebAPI project using .NET Core 3.1.0 and integration tests using XUnit.
I added the below task in Azure DevOps CI Pipeline (azure-pipelines.yaml) to run the integration tests project.
- ...
4
votes
2
answers
5k
views
Azure Devops Build failing for .Net 5 when using multiple frameworks
I have a project that builds using the following frameworks:
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
This compiles just fine on my local machine, but when ...
3
votes
2
answers
4k
views
Entity Framework Core - Disable Model caching , call onModelCreating() for each instance dcontext
Documentation Says : The model for that context is cached and is for all further instances of the context in the app domain. This caching can be disabled by setting the ModelCaching property on the ...
0
votes
2
answers
5k
views
SixLabors ImageSharp produces huge image files
I use the below code to resize JPG files to 200x240 pixels. The attached example file has a size of 900x600 pixels and is only 84 kb. However when I save the resized file using ImageSharp, the ...
0
votes
2
answers
3k
views
Dotnet core run as 32bit 86x on Linux
I'm trying to control RFID reader on linux using Dotnet core 3
ReaderDynamicLib.dll is main controller file which is not my created dll file. It is manufacture provided sdk file runs on only 32bit I ...
3
votes
0
answers
362
views
Self-contained .net core 3.1 app giving hostxfr.dll not found
I have a win-x64 app which is c++ calling a C++/CLI .Net Core DLL which is in turn calling a C# .Net core 3.1 DLL. It works fine on my development computer.
I've setup all of the projects to copy all ...
2
votes
1
answer
3k
views
Error extracting metadata in docfx project
Despite reading through the docfx documentation, and numerous Github issues, I am unable to get my docfx project working.
Steps taken:
Initialise root directory docfx init -q
Build from root ...
0
votes
3
answers
550
views
With DotNet (Core/Standrad) how do I the project version at build time?
I'm able to set the project version by adding the tag to the .csproj file,
but I'd like to change that value programatically inside the pipeline.
I hacked together a script to do accomplish that, but ...
1
vote
1
answer
1k
views
Blazor WebAssembly Azure DevOps build pipeline publish artifacts
We created a build pipeline yaml for our blazor webassembly project that includes a publish task. For some reason only the wwwroot folder items get generated into the drop folder, and all the other ...
0
votes
1
answer
1k
views
Azure DevOps: tests failing when addressing multiple .Net frameworks
[Edited: 10-Aug]
I have a project that generates a DLL (for a private NuGet package). This project is written to compile in the following frameworks:
<TargetFrameworks>netstandard2.0;...
4
votes
1
answer
14k
views
Azure pipeline task DotNetCoreCLI@2 - output folder of artifact
In our .NET Web API project, we tried to build API project in Azure DevOps and publish the artifact to a folder with the pipeline task below:
- task: DotNetCoreCLI@2
displayName: Publish web API ...
3
votes
2
answers
3k
views
How do I update my prod database with dotnet ef database cli command?
How do I get EF to build all the tables for the prod db?
So far I've been building and pushing all my .Net Core database migrations to the dev db
ex.
>dotnet ef migrations add InitialModsN -c ...
0
votes
0
answers
570
views
how to install dotnet core on ubuntu 20.4?
I'm trying to install Dotnet core on my server with this commands.
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i ...
3
votes
2
answers
3k
views
Azure Devops build pipeline doesn't build executables
I setup an azure build pipeline with the following Yaml
This project is a simple hello world console application, written in c# .net core 3.1
When I build or publish this project locally I get the ...
0
votes
1
answer
970
views
How to pass azure pipelines dotnet inputs to the linux dotnet binary
I am trying to replicate the following Azure pipeline using the CLI dotnet command:
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration ...
1
vote
0
answers
639
views
dotnet run and dotnet watch run sometimes takes over a minute to start on MacOS
I am not certain if it is limited to MacOS, I can only speak for it.
After developing for about half a day or so, starting up either dotnet run or dotnet watch run will sit and sit. It will take ...
0
votes
1
answer
423
views
dotnet restore failing with docker Jenkins container
I have a local docker image with the dotnet core 3.1 installed on the Jenkins/Jenkins:lts base image.
Running a shell script for a build configuration - I am getting an error on
> dotnet ...