csproj

Compiling a .vbproj or .csproj project file without Visual Studio

試著忘記壹切 提交于 2019-11-30 08:19:24
Is there a way to compile a .vbproj or .csproj project file directly, just like Visual Studio does? When you compile in Visual Studio, the "output" window shows the actual call to the compiler, which normally looks like: vbc.exe [bunch of options] [looooong list of .vb files] I would like to programatically call "something" that would take the .vbproj file and do whatever Visual Studio does to generate this long command line. I know i could parse the .vbproj myself and generate that command line, but I'd rather save myself all the reverse engineering and trial-and-error... Is there a tool to

How to conditionally reference a DLL based on a compilation symbol?

戏子无情 提交于 2019-11-30 05:12:00
Visual Studio 2013. I have an external DLL which I am referencing like this in the csproj file: <ItemGroup> <Reference Include="NameOfDll"> <HintPath>Path\To\Dll\NameOfDll.dll</HintPath> </Reference> I want this reference to function when a compiler symbol exists and to not function when that compiler symbol does not exist. (To address the first comment, below, let's say the compiler symbol is called Fred.) This question [ Conditional Reference ] made me think I could add an attribute called Condition to the Reference element shown above but I can't work out what value to give that attribute

Visual Studio 2017 csproj core file exclusion

 ̄綄美尐妖づ 提交于 2019-11-30 04:53:16
I've migrated xproj core projects to csproj . All is working well, however I still have issues with publish configuration. Based on documentation: https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json-to-csproj I should be able to exclude files during publish. I've added following lines to the f <None Include="*.json" CopyToPublishDirectory="Never" /> <None Include="wwwroot\**\*.map;wwwroot\**\*.less;*.pdb" CopyToPublishDirectory="Never" /> <None Include="wwwroot\**\*" CopyToPublishDirectory="PreserveNewest" /> But still *.map , .json and .less files are copied to publish

Pros and cons of Microsoft.AspNetCore.All metapackage [closed]

巧了我就是萌 提交于 2019-11-30 04:22:03
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . In ASP.NET Core 2.0 there is no need to include individual package references in the .csproj file. Microsoft.AspNetCore.All metapackage contains all the required packages. We can include this metapackage in .csproj file as: <PackageReference Include="Microsoft.AspNetCore.All"

How to read property value from external file?

流过昼夜 提交于 2019-11-30 03:20:24
问题 I have AssemblyInfo.cs file automatically generated during build. Here's part of .csproj file: <PropertyGroup> <Major>2</Major> <Minor>3</Minor> <Build>0</Build> <Revision>0</Revision> </PropertyGroup> <Target Name="BeforeBuild"> <SvnVersion LocalPath="$(MSBuildProjectDirectory)" ToolPath="C:\Program Files\VisualSVN Server\bin"> <Output TaskParameter="Revision" PropertyName="Revision" /> </SvnVersion> <AssemblyInfo CodeLanguage="CS" OutputFile="$(MSBuildProjectDirectory)\Properties

How to get rid of StyleCop

不问归期 提交于 2019-11-30 01:52:01
问题 Someone on our team installed StyleCop and since then all of the projects he loaded up and committed to source control refuse to load unless stylecop is installed. I know I can manually edit the .csproj files to get rid of it, but is there an easy way to automatically remove these stylecop parts from the project files so they can be loaded and built on a non-stylecop-infected Visual Studio machine? 回答1: I disabled StyleCop by adding the following GlobalSettings configuration to the file

Can the new csproj file structure be used with a ASP.NET Framework project?

梦想与她 提交于 2019-11-30 00:07:02
The new .csproj format includes some significant improvements over the classic files, including tight integration with NuGet package management and significantly less-verbose structure. I want to gain these benefits whilst still using the .NET Framework 4.6 and ASP.NET (because my project depends on Umbraco which has yet to produce a .NET Core version). The biggest challenge would seem to be the debugging experience - an ASP.NET Core project expects to run a dotnet core application and set up a reverse proxy to an IIS instance. This process is completely alien to the .NET Framework model and I

What is “Service Include” in a csproj file for?

人走茶凉 提交于 2019-11-29 19:24:32
In a C# solution, I added a existing project. After that, Visual Studio has added the following entry in other .csproj files: <ItemGroup> <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" /> </ItemGroup> What's this for? Can I delete it? I had a similar case, where this was added: <ItemGroup> <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> </ItemGroup> This inclusion turns out to be generated on purpose by VS2013 if you create an NUnit test project, but forget to tag it as test project, as described in this answer from Microsoft: This behavior is intentional. To support

Changing csproj OutputType based on project configuration

百般思念 提交于 2019-11-29 14:28:39
问题 I need to build a C# project as either WinExe or Library depending on the project's configuration. I've tried both of these methods with no luck: 1) In the general PropertyGroup: <OutputType Condition=" '$(Configuration)' == 'Release' ">WinExe</OutputType> <OutputType Condition=" '$(Configuration)' == 'Debug' ">Library</OutputType> 2) In a conditional PropertyGroup: <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <OutputType>WinExe</OutputType> </PropertyGroup> <PropertyGroup

BuildingInsideVisualStudio Property Value Not Working With File Reference and Project Reference Conditional

纵然是瞬间 提交于 2019-11-29 11:20:43
I am trying to add a project and file reference to the same dll in the csproj with the BuildingInVsideisualStudio property. But when they are in the csproj together, only the file reference is picked up. If I remove the file reference, it picks up the csproj. I have tried swapping the order, but no luck. Any ideas why this doesn't work? Here is the basic idea: <ItemGroup Condition="'$(BuildingInsideVisualStudio)' == false"> <Reference Include="MyNamespace.Mine"> <HintPath>..\$(OutDir)\MyNamespace.Mine.dll</HintPath> </Reference> </ItemGroup> <ItemGroup Condition="'$(BuildingInsideVisualStudio)