A file with the 'csproj' file extension is a Visual Studio .NET C# Project file.
Questions tagged [csproj]
1301 questions
0
votes
1 answer
How to remove elements in csproj with PowerShell
I try to remove elements from .csproj file, but my script does nothing. What am I doing wrong?
Script:
[xml]$csproj = Get-Content -Path ".\PackageTest.csproj"
$refs = $csproj.Project.ItemGroup | Where-Object {$_.Content.Include -like…

AlxZahar
- 73
- 9
0
votes
1 answer
Workflow for Referencing Projects in Multiple VS 2017 Solutions
I am looking for information on best practices when referencing C# projects in multiple solutions, in both debug and release modes. nuget and symbol servers (I use myget, and really like it) solves that for release packages.
But I'm confused about…

Mark Olbert
- 6,584
- 9
- 35
- 69
0
votes
0 answers
MsBuild ignores my assembly definition for CodeTaskFactory
I have Nuget.targets file referenced by all projects in my solution for restoring packages before build.
I have two tasks:

Sovent
- 119
- 2
- 13
0
votes
2 answers
Visual Studio Code .NET Core .csproj exclude
I have a .NET Core project using Visual Studio Code looks like
Angular2CLIApp
wwwroot
myproject.csproj
The Angular 2 CLI app has a depenedency on the selenium-webdriver which once installed places a Page.aspx.cs (+ some) file into the node_modules…

maehue
- 505
- 10
- 26
0
votes
1 answer
Hint Path is messing up Nuget Restore
I've got 3 projects in my solution; Api, Tests and Tests.Acceptance. When I bring the solution down from Git the Test and Test.Acceptance files fail to restore.
I've tried adding a .nuget\NuGet.config\ with the following code

Questioning
- 1,903
- 1
- 29
- 50
0
votes
2 answers
Include XML file from package when using "Publish Web"
I have a Web API project that depends on a NuGet package. This package contains an XML file that is referenced by my application at runtime.
When I build the solution and run it in debug mode from Visual studio the file gets copied to \bin, and the…

Petter Brodin
- 2,069
- 4
- 21
- 27
0
votes
1 answer
MSBuild Import Custom Target
I have a common target file that has AfterBuild . The target file is at solution level. All csproj Import custom target file using

varun7447
- 574
- 1
- 6
- 27
0
votes
1 answer
Import a VS2010 csproj in a VS2005 solution
I want to import a .csproj create with VS2010 in my VS2005 solution. But I have the following message :
The imported project "C:\Microsoft.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file…

Florian
- 4,507
- 10
- 53
- 73
0
votes
1 answer
Visual studio 2017 and nuget package
I am creating nuget package which should contain also config file. Problem is that if I want to use csproj for nuget package definition, I don't know how to specify that config file should be copied and "copy to output directory" on file set when…

Ondrej Tomcik
- 1,150
- 9
- 24
0
votes
1 answer
MSBuild copy task on demand or on save
I have a csproj file that copies shared (linked) files on build, like this:

user5328504
- 734
- 6
- 21
0
votes
1 answer
Removed item using Microsoft.Build.Evaluation.Project.RemoveItem
I want to remove file programatically using Microsoft.Build.Evaluation.Project.RemoveItem for that I have written following lines of code.
var projectFileName = HttpContext.Current.Server.MapPath("~/test.csproj");
var strIncludeFiles = new…

Pankaj
- 3,131
- 4
- 14
- 22
0
votes
1 answer
Target framework in output file name from C# when using multi targets
When I compile a C# application, the filename of the output is ProjectName.dll.
But how do I do if I want the filename to be ProjectName.net46.dll?
Edit
I want that the outputs to be ProjectName.net46.dll and ProjectName.net40.dll if I use…

magol
- 6,135
- 17
- 65
- 120
0
votes
1 answer
How can Android Assets be packaged without specifying each one indvidually in Xamarin Droid build system?
Using Xamarin I want to produce an android apk, that contains a large number of assets. I don't want to have to add each one individually in the csproj, due to the large number and due to the changeability of the assets. (produced via a prior build…

Tom
- 6,325
- 4
- 31
- 55
0
votes
2 answers
Custom property on projectfile preset by solution
I'm having a custom property on my project to build the same app with different ressources (images).
project.jsproj

kerosene
- 930
- 14
- 31
0
votes
0 answers
Adding the references to the project just before the build
I need to add some references to another project or dll just before the build process in Visual Studio 2015 starts and then I need to remove the reference after build.
Is it possible and what is the best approach for this?
Can I also add shared…

Dzior
- 1,485
- 1
- 14
- 30