Caeden
Caeden
CC#
Created by Caeden on 1/20/2024 in #help
Combine string formatting (eg `$"{number:N2}" with D2) so like `{number:N2D2}`)
You have string interpolation like $"{number:N2}", how can I combine formats? Like $"{number:N2D2}"
12 replies
CC#
Created by Caeden on 1/13/2024 in #help
Github actions failing to run project (dotnet run)
> dotnet run
Failed to create CoreCLR, HRESULT: 0x80070057

> dotnet run
Failed to create CoreCLR, HRESULT: 0x80070057

In the github workflow
> dotnet version
8.0.101
> dotnet version
8.0.101
This is the csproj which may be the problem
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Current on windows os and when running dotnet run in the dir it works perfectly fine - github action ran from ubuntu/ This is the github action
name: Test dotnet package

on:
push:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '8.0.x' ]

steps:
- uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Display dotnet version
run: dotnet --version
- name: Run project
working-directory: ./simulation
run: dotnet run
name: Test dotnet package

on:
push:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '8.0.x' ]

steps:
- uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Display dotnet version
run: dotnet --version
- name: Run project
working-directory: ./simulation
run: dotnet run
24 replies
CC#
Created by Caeden on 10/8/2023 in #help
❔ Creating a github workflow to test solution (MSTest)
I have this solution https://github.com/caedenph/wa-tor I have two projects within it, the base one is the implementation of this algorithm, and the other project is within WaTorTests/. How can I link the tests in WaTorTests/ to the root project so that I can run dotnet test? For context:
> dotnet test
MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
> dotnet test WaTorTests
Determining projects to restore...
Nothing to do. None of the projects specified contain packages to restore.
> dotnet test
MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
> dotnet test WaTorTests
Determining projects to restore...
Nothing to do. None of the projects specified contain packages to restore.
37 replies
CC#
Created by Caeden on 10/5/2023 in #help
❔ Creating a github workflow to test solution (MSTest)
I have this solution https://github.com/caedenph/wa-tor I have two projects within it, the base one is the implementation of this algorithm, and the other project is within WaTorTests/. How can I link the tests in WaTorTests/ to the root project so that I can run dotnet test?
5 replies
CC#
Created by Caeden on 10/5/2023 in #help
❔ Optional function parameter
I have this function public void abc(Entity entity, List<string> directions, Position occupied = null but I get CS1750: A type of value <null> cannot be used as a default parameter because there are no standard conversions to type Position
29 replies