csproj

.NET Core - build project specifying ReferencePath

天大地大妈咪最大 提交于 2019-12-10 16:46:10
问题 I have a .csproj for the .NetCore platform with classic references. I'm using the hintpath attribute for the development environment. But I should build csproj on the CI-environment where referenced assemblies are placed in the different directory. On the classic net4 I've used the /p:ReferencePath argument for the MSBuild tool. But the "dotnet build" has no similar argument. As a fallback I found the "dotnet msbuild" command but this tool is ignores the /p:ReferencePath=xxx argument and

Add dependency to .net core csproj file

喜欢而已 提交于 2019-12-10 13:59:51
问题 I am using prerelase version of .net core (build 1.0.0-preview3-004031). There is no project.json files and they replaced with csproj. I can't find any sample describing how to add dependency to csproj for .net core. 回答1: You can find a few information about the .net core csproj in the .NET Blog. There you'll find a csproj sample and also how to migrate from project.json to csproj . There's also a link to project.json to csproj mapping by scenario. 来源: https://stackoverflow.com/questions

dotnet core 2 long build time because of long restore time

北战南征 提交于 2019-12-10 12:48:10
问题 I noticed that building in dotnet core 2 seemed a lot slower. But the timing after the build always showed 'only' 15 seconds. I couldn't believe that so I timed it with time . > time dotnet build Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. hrm -> /Users/r/dev/hrm/bin/Debug/netcoreapp2.0/hrm.dll Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:15.45 real 0m52.366s user 0m36.851s sys 0m15.458s That seemed

Can I use both wildcard and Link element inside the Compile element?

狂风中的少年 提交于 2019-12-10 03:54:23
问题 In the .csrpoj file, If I have <Compile Include="c:\path\File1.cs"> <Link>Dir1\File1.cs</Link> </Compile> Then Visual Studio shows that file as a shortcut under Dir1 folder in the Solution Explorer. If I have <Compile Include="c:\path\*.cs"></Compile> Then all .cs files show up as shortcuts in Solution Explorer at top level: Is there a way to include all files in some folder and make then show up under a sub-folder? Omitting the filename in Link element does not work: <Compile Include="c:

Harvesting a .csproj with heat.exe in Visual Studio 2008 and WiX(v3)

帅比萌擦擦* 提交于 2019-12-10 03:41:43
问题 I found that Wix v3 uses a tool (heat.exe) to "harvest" information into WiX fragments. Either I am looking in the wrong location, or this is thinly documented. What is the best way to auto-generate a WiX fragment (likely using heat.exe) for a complex folder structure that contains media files: Of varying types (ico/png/xaml/etc) That may change regularly (names/locations/adds/removes) That are classified as "Content" and included in a .csproj such that they can be built into an installer via

What controls the ProductVersion setting in .csproj files?

随声附和 提交于 2019-12-10 02:48:55
问题 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? 回答1: That's the version of Visual Studio used to load the .csproj, so it knows what

Why did reinstalling Silverlight break my Import configuration?

本秂侑毒 提交于 2019-12-10 02:31:08
问题 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

How to use a custom attribute on an assembly in .NET Core 1.1

久未见 提交于 2019-12-09 15:41:48
问题 While I found this post regarding retrieving a custom attribute on an assembly, I am unsure on how to add a custom attribute to an assembly in .NET Core 1.1. In .NET Framework, I would have done something like: [assembly: AdditionalLocation(@"..\ReadFromHere")] But my netcore1.1 projects in Visual Studio do not have an AssemblyInfo.cs. Where would I declare a custom attribute for an assembly? Is there something I can put in the .csproj file? 回答1: You can always create a new AssemblyInfo.cs

Detected package downgrade warning (dotnet core, vs 2017)

北城余情 提交于 2019-12-09 04:16:59
问题 I have just updated all my nuget packages for my solution (dotnet core 1.1 project). I am now getting the following warnings and I don't really know what they mean. Update: I am still getting warnings mentioned above. My web projects warn about the Microsoft.NETCore.App package (see screenshot below) and my lib projects warn about NETStandard.Library (see screenshot above) When trying to update Microsoft.NETCore.App in the NuGet package manager, I am getting the following error: Hope someone

Adding custom information to CSPROJ files

ぃ、小莉子 提交于 2019-12-08 16:03:15
问题 As part of our development life cycle we have a number of process that we run against the C# source in our projects. The processes are driven off a GUI that currently reads the *.csproj file to find the source files used within the project. This works fine. We now have a new requirement to provide some validation processes that require a call out to a web-service. The web-service needs to be provided with some credentials that are project specific. Ideally we could enter and store these