m1dnight
m1dnight
CC#
Created by m1dnight on 6/26/2024 in #help
Test project in project where project is in same folder as solution (codecrafters.io)
I am going through codecrafters.io DNS server with C#. The barebones project you get looks like this:
.
├── README.md
├── codecrafters-dns-server.csproj
├── codecrafters-dns-server.sln
├── codecrafters.yml
├── src
│   └── Server.cs
└── your_server.sh
.
├── README.md
├── codecrafters-dns-server.csproj
├── codecrafters-dns-server.sln
├── codecrafters.yml
├── src
│   └── Server.cs
└── your_server.sh
I want to add a unit test solution to this project, but I can't manage to get it working. From what I can tell, codecrafters really wants their project to keep this structure. I'm using Rider and tried adding new project to the solution, but then I get the following error:
CS0579: Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute
CS0579: Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute
I attempted to fix this by adding the following to the .csproj file.
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
Is there a way to create a unit test project that does not mess with the codecrafters repository?
3 replies