csproj

Where is full documentation about the csproj format for .net core?

ぐ巨炮叔叔 提交于 2019-12-12 09:30:01
问题 Is there a full documentation about the csproj format for .net core projects? I was looking for a way to copy files before building. After some searching I found a solution, but I can't find the documentation for this. Does it overwrite files? Are there extra options, ... <Target Name="CopyMyFiles" BeforeTargets="Build"> <Copy SourceFiles="../../someFile.js" DestinationFolder="dest/" /> </Target> I found the additions for .net core here, but there is nothing about copy. Does that mean copy is

How to access macro variables within csproj file?

半世苍凉 提交于 2019-12-12 08:49:17
问题 In my csproj file, I have a different build path. <BaseIntermediateOutputPath>C:\Temp\Build\MyProject</BaseIntermediateOutputPath> When in the prebuild and post build events, I have access to certain macro variables. $(OutDir) $(ProjectName) $(ProjectPath) $(SolutionDir) Can I use those variables within my csproj? For example, I tried the following without success. <BaseIntermediateOutputPath>C:\Temp\Build\$(ProjectName)</BaseIntermediateOutputPath> 回答1: I had a similar requirement and using

Conditional conditional symbol definition in a .csproj file

不问归期 提交于 2019-12-12 04:35:35
问题 I am an experienced C# developer, but a complete beginner when it comes to MSBuild, and now I have a .csproj file containing the following XML snippet: <Choose> <When Condition=" $(UseSimulatedResx) == true "> <PropertyGroup> <DefineConstants>$(DefineConstants);SIMRESX</DefineConstants> </PropertyGroup> ... does something else ... </When> </Choose> Is there way any anyone can explain me how and when the excerpt above should work? Where and when should I issue this UseSimulatedResx? What I

How to add existing item to Visual Studio project, copy to output but change it's original name?

不想你离开。 提交于 2019-12-12 03:26:34
问题 I added a chm help file as link to the application's project but it's file name is not good for releasing to the public ("Compiled help.chm"). Unfortunately it's maintained in a different git submodule by other people and it's name is an automated output from their help builder. After adding file as link there is no option to change the file name. Is there a csproj xml feature allowing user to rename a file link, possibly without breaking WiX installers depending on it and other undesired

Enumerate Files in a .csproj (dotnet core)

心不动则不痛 提交于 2019-12-11 16:56:21
问题 I am working on a build tool in C# that should work with Visual Studio / MSBuild. I want to enumerate all files that are part of a C# project. The project format is the new (.NET Core) .csproj. The documentation describing the Project System points at using MSBuild (file format) or Common Project System (project tree). I'm unfamiliar with both APIs. Looking at documentation for those respective projects is not immediately helpful. As the expert probably knows, the new .csproj file does not

Add as link to within a project folder to copy always to root of output

末鹿安然 提交于 2019-12-11 13:11:35
问题 I'm doing some interop with unmanaged .dll s in a standard c# project. I cannot add these .dll s as simple references and have to use P/Invoke to actually use them. They don't include manifests so doing any clever reflection stuff to load these dynamically (And thus solve the problem of including them as explicit, separate files) is simply out of the question. I am not concerned with installer releases, I can tell WiX(Or whatever installer platform I choose) what files to exactly put where on

Referencing runtime content from .ccproj (Azure SDK 2.9)

妖精的绣舞 提交于 2019-12-11 08:48:25
问题 I have a worker role that contains a reference to a few nuget packages that drop a few needed runtime files as a post-build step to the project bin folder. The problem I'm facing is that these files are not being copied over to the published worker role as they are not tracked by the worker role .csproj Worker role .csproj: ... <Import Project="[path-to-nupkg]\build\package.targets" Condition="Exists('[path-to-nupkg]\build\package.targets')" /> package.targets copy post-build resources, so

PackageReference condition is ignored

 ̄綄美尐妖づ 提交于 2019-12-11 08:07:23
问题 In my VS 2017 project I reference docfx.console package and I want it to be used only when certain condition is met. But the package gets used for all builds. Here is a part of my project. I want docfx.console to be used when configuration is Installer/AnyCPU and VS is building net40 flavor. <?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>net40;netstandard1.3;netstandard2.0</TargetFrameworks> <!-- ... --> <Configurations>Debug;Release

Building 2 programs in a C# project

懵懂的女人 提交于 2019-12-11 07:46:14
问题 Short Version In a C# project created by dotnet new console , all of the *.cs files, even the ones in subdirectories, are compiled into a single program. If there are 2 classes with Main functions, it fails to build. How do I tell it to build 2 programs? More Details As a newcomer to C# and all of the related tools, I followed the tutorials, and learned how to create a minimal project by running dotnet new console , throw in some *.cs files, and run the resulting program with dotnet run . I

Visual studio project template replaces “$(SolutionDir)” macro in template on build

懵懂的女人 提交于 2019-12-11 05:18:36
问题 I am trying to make a project template for internal use that has all of the custom parts of our assembly versioning system. The default project template works perfectly with our pre-build and post-build event but when I try to reference a file using the $(SolutionDir) macro it gets replaced during the building of the template and <ItemGroup> <Compile Include="$(SolutionDir)\CommonAssemblyInfo.cs"> <Link>Properties\CommonAssemblyInfo.cs</Link> </Compile> <Compile Include="Properties