1,397 questions
1
vote
1
answer
961
views
Create nuget package while solution uses clean architecture
I have solution that uses clean architecture, so I have following projects:
Core
Application that depends on Core
Infrastructure that depends on Application
Web that depends on Application and ...
0
votes
1
answer
623
views
Dotnet build: How to copy content output from dependency to output folder?
I have a two unit test projects, Tests.Common and Tests.Foobar.
Tests.Foobar references Tests.Common as a dependency.
Tests.Common includes content files that are used by both Tests.Common and Tests....
1
vote
1
answer
363
views
How to tell Visual Studio (MSBuild) to copy all files in the folder, including empty folders?
I have a Template folder in the project that should not be compiled or anything but should be included when built so my app can copy it later. The content may include C# files as well. I previously ...
0
votes
0
answers
67
views
Can I make one postbuildevent occur after another in a csproj?
I'm trying to make one postbuildevent to go, and then after that finishes, then do the other postbuildevent, don't know if this is possible.
I really had no idea how to do this and I couldn't find any ...
2
votes
1
answer
1k
views
Setting AssemblyAttribute in .csproj file with enum value
I want to set an AssemblyAttribute with an enum parameter in the .csproj file.
How do I achieve that?
I am aware that I can set it the following way within a file:
[assembly: TestDataSourceDiscovery(...
0
votes
0
answers
87
views
MSVS - WPF - How do I make ProjectName.csproj build App.xaml and App.xaml.cs last?
My WPF project has App.xaml require other pieces of project code to be built before it gets built. Despite App.xaml's dependency on those classes and xaml files, Visual Studio wants to build it first ...
1
vote
1
answer
594
views
LaunchSettings.json can't handle \n
I'm have a Project with a LaunchSettings.json
it looks like this
LaunchSettings.json
{
"profiles": {
"Profile 1": {
"commandName": "Executable",
...
0
votes
0
answers
199
views
Handling resources when migrating from old style csproj to sdk csproj
I'm trying to migrate from an old style csproj file where I have this in the file
<ItemGroup>
<Resource Include="Resources\CustomerLogo.png" />
</ItemGroup>
and ...
0
votes
1
answer
2k
views
Does Visual Studio ignore DefineConstants in csproj?
I have a CSPROJ in which I define my own constant / compiler directive.
<PropertyGroup>
<DefineConstants>$(DefineConstants);MY_DIRECTIVE</DefineConstants>
<MY_DIRECTIVE>...
0
votes
1
answer
508
views
MSBuild tries to copy files overwritten as part of the PreBuildEvent
When I'm building the application, one of the PreBuildEvents is the build of the React front-end:
<PropertyGroup>
<PreBuildEvent>
powershell.exe "npm --prefix ""&...
0
votes
1
answer
1k
views
Force re-download of solution and project NuGet packages without reinstall
Is there a way via NuGet.exe or within Visual Studio 2022, natively or via the Package Management Console, to only re-download all packages for a given solution and/or project without re-installing ...
0
votes
1
answer
215
views
I want to setting T4 Template with wildcard in csproj
What I do
I have multiple tt files in my project file.
Therefore, many entries are created for each file as follows.
<ItemGroup>
<Compile Update="Sample.cs">
<DesignTime&...
0
votes
1
answer
300
views
Is there somebody who is getting build failure while deploying to azure devops as below
I am trying to deploy my function app on azure using the following code:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</...
1
vote
1
answer
3k
views
Adding dll reference in .Net standard 2.0 project
I want to add Dll reference of system assembliesSystem.Runtime.Caching assembly in my .net Standard 2.0 project(using VS2019). Due to some policy restrictions nuget usage is not possible so we need to ...
1
vote
1
answer
363
views
TeamCity build error MSB3202 can't find file csproj
Get error then i run build:
[dotnet build] in directory: /opt/buildagent/work/d19a958ec8a4811c
[08:40:52] [dotnet build] Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
[08:40:52] [...
1
vote
0
answers
526
views
dotnet publish not detected runtimeidentifiers
In my .csproj file, i have the following written:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>...
1
vote
0
answers
3k
views
how to add local nuget package in the project file(.csproj)
I want to source some classes into another project. So, i have created a nuget package and want to use it in the project file(.csproj) file. So, that when i build my project it automatically uses the ...
5
votes
1
answer
5k
views
Any way to ignore all warnings of a nuget package in csproj file
Is there a way to ignore all warnings of a nuget package by using the
<NoWarn></NoWarn>
tag in csproj file?
6
votes
1
answer
515
views
Using Text Transform (.tt) templates in GitHub Actions
I am trying to use Text Transform templates (a feature of Visual Studio) with GitHub Actions. I am specifically using the Windows runner, which has Visual Studio 2022 Enterprise installed, so the ...
0
votes
0
answers
345
views
Run Target when dependent project is build
I have a ASP.NET project with a HTTP API and a classlib as a client project. I'm generating a .NET client with NSwag using a MSBuild task.
My goal is that
the client is generated before the build of ...
0
votes
1
answer
321
views
Powershell script is not adding node in .csproj file [duplicate]
I am writing a powershell script to automate some of the boilerplate setup when initiating a .NET Core Blazor application, and for some reason it is not properly updating the .csproj file. What I ...
0
votes
0
answers
418
views
Question about the Import tag inside a csproj file
Inside my project I have a csproj file where at the top of the file it says:
<Import Project="..\packages\Grpc.Tools.2.31.0\build\Grpc.Tools.props" Condition="Exists('..\packages\...
0
votes
0
answers
426
views
Using multiple versions of a dependency in the same project
One of my clients wants to port an old version of a SAML 2.0 library (ComponentSpace.SAML2) to the newest version. As part of this job, I'm required to write unit tests which verify that the generated ...
1
vote
1
answer
2k
views
How do I include .deps and .runtimeconfig files as project dependencies?
Visual Studio creates two files along with the .exe for my project that are required to run the exe: a deps.json and a runtimeconfig.json. A second project in my solution has the first project as a ...
1
vote
0
answers
510
views
Remove file from package reference
I have a dependency on the NuGet library:
<ItemGroup>
<PackageReference Include="OpenCvSharp4.Windows" Version="4.5.3.20210817" />
</ItemGroup>
This package ...