csproj

What controls the ProductVersion setting in .csproj files?

不羁的心 提交于 2019-12-05 02:16:58
Every now and then our source control engine indicates that the ProductVersion in a .csproj file has changed. We're using VS2008 SP1. Looking through the codebase I can see two versions reported: <ProductVersion>9.0.30729</ProductVersion> and <ProductVersion>9.0.21022</ProductVersion> Does anyone know why and when Visual Studio decides to change this setting, and to what these two version numbers refer? That's the version of Visual Studio used to load the .csproj, so it knows what capabilities the project might contain (if new versions of VS change the format of the proj file). It will change

Why did reinstalling Silverlight break my Import configuration?

断了今生、忘了曾经 提交于 2019-12-05 01:16:40
Based on the answer here: Which, if any, recent Windows updates should I uninstall to revivify Silverlight or rectify other problems? , I uninstalled / reinstalled Silverlight and rebooted. Now, though, I get a compilation error, namely: "The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk." It points to this line in a *.csproj file: <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft

How to Set AutoGenerateBindingRedirects in Visual Studio for Mac?

我与影子孤独终老i 提交于 2019-12-05 01:16:09
问题 I'm currently working on a Xamarin.Forms project named ABCD, using macOS Sierra v10.12.6 and Visual Studio (VS) for Mac v7.3.2 (the set up steps are detailed here). Having successfully set that up, I continue as follows: Right-clicking the main project folder, I select Options . Under Build , in General , under Target Framework : .NET Portable: PCL 4.5 - Profile111 has been automatically selected for me. I switch this to the option right above it: .NET Standard Platform: netstandard1.5 ; then

How to make Sonarqube exclude a .NET (C#) project from coverage measures

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 22:56:51
问题 Sonarqube allows for individual files to be excluded from code coverage by adding patterns in the sonar.coverage.exclusions key. This can be done on a project level by adding them in the UI and even in a .csproj file by specifying a SonarQubeSetting element. I.e. <SonarQubeSetting Include="sonar.coverage.exclusions"> <Value>**/*.cs</Value> </SonarQubeSetting> However, both of these approaches don't seem to work. Playing with the patterns, as specified in the SonarQube documentation doesn't

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

强颜欢笑 提交于 2019-12-04 22:54:34
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 somehting from msbuild? The target element is documented here But I don't find anything about copy.

How to embed an XSLT file in a .NET project to be included in the output .exe?

早过忘川 提交于 2019-12-04 21:31:10
问题 I have a simple C# Console App that reads in an XML file specified the the user, runs an XSLT transformation on it, and outputs the results. When I distribute my app to users, I want to distribute a single .EXE file. My source code consists of 3 files: the .csproj file, the .cs code file, and a .xslt stylesheet. How can I set up the csproj so the .xslt is "embedded" within the output and cannot be seen or modified by the end user? Seems easy, but I can't figure it out and Google isn't being

How to make an MSBuild Target that only runs once instead of once, before Targets that run once per framework in the TargetFrameworks tag?

╄→гoц情女王★ 提交于 2019-12-04 19:12:26
I have a code generator tool that I partially own, and now that csproj files can list multiple Target Frameworks in them and building builds all of them, I am trying to figure out how to make an MSBuild Target to do the code generation only once per running the build, no matter how many Target Frameworks are listed, and have the compiling for each of the Target Frameworks wait until the code generation has completed. I currently have it conditional on a specific value of TargetFramework. For example, Condition="'netstandard2.0' == '$(TargetFramework)'" . This avoids the code generation tool

Should assembly guid attribute vary for different target framework builds of the same .NET library?

不羁的心 提交于 2019-12-04 15:19:20
I am developing a .NET library in C# which has to address a wide set of target frameworks. I want to produce a nuget package that would install correctly according to the settings of the target project. In order to achieve that, I am using multiple .csproj files. Each of them is addressing a particular target framework (for example MyLibrary.net45.csproj would create the binaries in bin/*/net45 , MyLibrary.netstandard1.2.csproj would create the output in bin/*/netstandard1.2 , and so on). Then I create a single nuget package with the outputs of the above projects. At this stage, the different

How to make version autoincrement in the latest .NET Core tooling?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 10:16:23
I am using the latest (as of today) .NET Core tooling. There, you specify version in an <Version> MSBuild property. However, unlike [assembly:AssemblyVersion], this does not appear to support wildcards. How do I make version increment automatically in the same way? Explaining why this is a bad idea, and what should be done instead would also be a good answer. natemcmaster The Version property in MSBuild does not support asterisks (wildcard) format as project.json did. However, with MSBuild you can compute a version in other ways. There is no one right way to do it, but here is one approach. We

How to access macro variables within csproj file?

六眼飞鱼酱① 提交于 2019-12-04 06:33:48
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> I had a similar requirement and using $(MSBuildProjectName) did the job for me. <PropertyGroup> <ProjectView>ProjectFiles</ProjectView>