csproj

web deploy package not picking up parameters.xml when using latest csproj format

末鹿安然 提交于 2019-12-07 03:16:26
I have a project which is being updated to use the new .csproj format. We used to use the following msbuild arguments: msbuild Logging.sln /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="C:\Source\webdeploy" Which created a .zip web deploy package. In the top level of this folder was parameters.xml, which is a copy of a custom parameters.xml from the project being built. Since moving to the new .csproj format, the .zip is still being created, but the parameters.xml file inside the .zip is incorrect. I'm not sure where it comes from,

VS 2017 new project format and external props file

戏子无情 提交于 2019-12-06 12:31:44
Lets say I have the following project file: <Project> <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> <PropertyGroup> <TargetFramework>net47</TargetFramework> </PropertyGroup> <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" /> </Project> Is it possible to move TargetFramework property to external props file? When I try doing that, Visual Studio gives me a "one-way upgrade" error. You've hit a known issue in the way that Visual Studio interprets csproj files. On command line (msbuild.exe or dotnet.exe) you can build a project with the property TargetFramework coming in from an

Visual studio 2012 project - Not able to load 'Newtonsoft.Json'

久未见 提交于 2019-12-06 12:09:04
问题 On running a windows phone project in VS 2012, I was getting this error: {System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. File name: 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' at MobileConnection.SSCClient.SSCConnection.GetHostNameAndPort() at MobileConnection.SSCClient

MSBuild: Include a custom resource file as embedded resource

99封情书 提交于 2019-12-06 11:55:30
I am dynamically generating a resource-file at build time with MSBuild, but in order to be able to read from this resource file at run-time, I need it to be an embedded resource. I have looked everywhere at how to mark a file in a .csproj as embedded resource, I have even tried this to no avail. <ItemGroup> <Content Include="Infrastructure\Content\Store\content_store_en.json" /> <EmbeddedResource Include="Infrastructure\Content\Store\content_store_en.json"> </EmbeddedResource> </ItemGroup> Is there any way I can achieve this ? Here is how you do it: <Target Name="BeforeBuild"> <CreateItem

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

China☆狼群 提交于 2019-12-06 11:54:45
问题 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).

open a .csproj with monodevelop

时间秒杀一切 提交于 2019-12-06 09:14:23
I've downloaded a framework with samples in .csproj project format. How can I open them in MonoDevelop? I'm interested in using some classes in that framework. It has a folder structure like: Accord.Statistics.Models and a main folder Accord with a subfolder Statistics with a subfolder Models with a file ModelFoo.cs I want to use that file (that begin with namespace Accord.Statistics.Models ) in a MonoDevelop Solution under Ubuntu. If I copy the folder or single files inside my new Solution I get the error Are you missing a using directive or an assembly reference? How can I do? Create a new

How to read/get a PropertyGroup value from a .csproj file using C# in a .NET Core 2 classlib project?

[亡魂溺海] 提交于 2019-12-06 07:13:26
问题 I want to get the value of the element <Location>SourceFiles/ConnectionStrings.json</Location> that is child of <PropertyGroup /> using C#. This is located at the .csproj file for a .NET Core 2 classlib project. The structure is as follow: <PropertyGroup> <TargetFramework>netcoreapp2.0</TargetFramework> <Location>SharedSettingsProvider.SourceFiles/ConnectionStrings.json</Location> </PropertyGroup> Which class can I use from .NET Core libraries to achieve this? (not .NET framework) Update 1: I

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

梦想与她 提交于 2019-12-06 06:57:17
问题 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. 回答1: The Version property in MSBuild does not support asterisks (wildcard) format as project.json did. However, with MSBuild you can

Project generates a nuget package that depends on another project that does not create a nuget package

那年仲夏 提交于 2019-12-06 03:47:53
If I have a project (P1) that builds a nuget package, and I make it depend on a project (P2) that doesn't build a nuget package, the generated package will still reference P2 as a nuget package . Steps to reproduce Create a solution with 2 C# projects (P1 and P2) Make P1 depend on P2. Add the following line to P1.csproj (to make it build a nuget package) <GeneratePackageOnBuild>true</GeneratePackageOnBuild> Build the solution Open the generated P1.nupkg in, e.g., NuGet Package Explorer Note that the NuGet package depends on another NuGet package called P2. However, that package does not exist,

How to specify different nuget package versions for different build configurations?

≡放荡痞女 提交于 2019-12-06 01:44:16
I'd like to specify different package versions for different project configurations. I know what this would look like in my .csproj file for non-NuGet dependencies ("bare" DLLs), but I'd like to try and get this working with NuGet packages too. The problem is that NuGet dependencies are specified in packages.config and not in the .csproj file, where I could use the MSBuild Condition attribute. This is compounded by the fact that there does not appear to be any documentation for packages.config and the attributes it supports. Can this be done? How? In 2019 PackageReference which is using the