csproj

Where to place the dll files to resolve the reference

人盡茶涼 提交于 2019-12-11 05:09:29
问题 I have a dotnet project codebase without documentation. To build, there are batch files available. When I open the .sln file in VS, there are reference errors, which can be cleared by modifying .csproj file and updating <Reference Include="MyLibrary.module, version=1.0.1, Culture=neutral, PublicKeyToken=randomstring" /> with <Reference Include="MyLibrary.module, version=1.0.1, Culture=neutral, PublicKeyToken=randomstring"> <HintPath>path-to-dll-here</HintPath> </Reference> But rather then

How to specify output folder for the referenced nuget packages?

做~自己de王妃 提交于 2019-12-11 03:56:33
问题 I have a project with some nuget packages referenced. In output folders ( bin\Debug or bin\Release ), all referenced libraries lie next to the executable. How to specify output folder for libraries? I want all nuget libraries in bin\Release\Libs and executable in bin\Release . 回答1: I woke up early this morning and decided to have a go at doing it myself. Turned out to be pretty quick, but that may be because of my (unfortunate) experience with looking into MSBuild files. Writing this post

Build All projects in a directory

可紊 提交于 2019-12-11 03:07:59
问题 Im try to build my plugins that sit in a seperate directory on the root. <ItemGroup> <PluginProjectFiles Include="$(MSBuildStartupDirectory)..\..\Plugins\**\*.csproj"/> </ItemGroup> <Target Name="BuildPlugins"> <MSBuild Projects="@(PluginProjectFiles)" Targets="Clean;Build" Properties="Configuration=Release" /> <Message Text="Dir: $(MSBuildStartupDirectory)" /> </Target> Although im having problems. My build runs the 'BuildPlugin' Target but it doesn't build my project files. I really don't

Build Project with multiple targetframeworks in tfs as nuget package

ぃ、小莉子 提交于 2019-12-11 03:03:32
问题 I want to build my nuget package in one of my tfs build steps. Because .Net-Standard2.0 is currently not supported by the TFS-NuGet-Step I am using /t:pack as build argument in my msbuild . When I only use one TargetFramework it is working fine. My Assemblies get a Version and my Nuget-Package too. Even if I am using an AssemblyInfo.cs in .Net-Standard2.0 - explained in this answer. So far no problem, but If I want to build now on two different TargetFrameworks like <TargetFramework

Asp.net core 2 - Files are not published

风流意气都作罢 提交于 2019-12-11 00:04:50
问题 EDIT For info, I'm developping on macOS using VS Code I'm trying to include files in my publish process ( Currently cshtml that represents my email templates ). I follow this thread on github but seems that their solutions don't work for me. Here my csproj to add an unique cshtml file : <Target Name="PrepublishScript" BeforeTargets="PrepareForPublish"> <ItemGroup> <EmailFile Include="$(ProjectDir)/EmailTemplates/OrderCompleteEmail.cshtml" /> </ItemGroup> <Copy SourceFiles="@(EmailFile)"

MSBuild AfterBuild messages not showing real-time

人盡茶涼 提交于 2019-12-10 20:07:48
问题 I have something like the following in the .csproj file for an ASP.NET MVC 4 project in Visual Studio 2012: <Target Name="AfterBuild"> <CallTarget Targets="InstallBuildDependencies" /> <CallTarget Targets="BuildAssets" /> </Target> <Target Name="InstallBuildDependencies"> <Message Text="Installing build dependencies:" Importance="high" /> <Exec Command="npm install" /> </Target> <Target Name="BuildAssets"> <Message Text="Building assets:" Importance="high" /> <Exec Command="grunt build" /> <

How to add new PropertyGroup to csproj from powershell

三世轮回 提交于 2019-12-10 19:28:13
问题 I have the following ps1 file. There are three problems in this file. Q1. How to use single quote and double-quote in XML? I googled and found that I need to put one extra single quote. I tried but didn't work. Q2. I got "wrong type" error when I append new PropertyGroup as a child to Project node. How can I fix it. Q3. Can I append multiple PropertyGroups to Project Node? $dir = "C:\Work\scripttest\output\" $ns = @{ defaultNamespace = "http://schemas.microsoft.com/developer/msbuild/2003" }

.NET Entity Framework Core

ぐ巨炮叔叔 提交于 2019-12-10 19:19:03
问题 I've already read through pretty much every other issue regarding EF in that was posted in the past 2 years. I have had no problems downloading other packages, it's only Entity Framework that will not install for me. I've even tried installing the latest version of Nuget and using it's tool inside of my project directory to restore the packages -after- I added a this line to my .csproj: <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.2" /> First I

Modify .csproj in pre-build event

核能气质少年 提交于 2019-12-10 19:09:51
问题 tl;dr: How to modify the .csproj file during publishing with ClickOnce while executing pre-build events? Long: I'm using TFS hosted by Microsoft for version control of my solution. When publishing with ClickOnce , I get the latest revision number + 1 without problems. I also can successfully write the new version number into the .csproj file outside my build-process. The problem is, that the .csproj file doesn't get updated during the build process - it might be in a write-lock. I get a

Referencing an ASP.NET xproj from a csproj

老子叫甜甜 提交于 2019-12-10 18:24:18
问题 I'm using one of those new "Class Library (NuGet Package)" templates from Visual Studio, and I want to create an xUnit test library for it. The problem is, when I create a new .csproj library and try to reference the .xproj package, Visual Studio says "The reference to XXXX could not be resolved." Why is this happening and what can I do to fix this? 回答1: You can use the SideWaffle template pack VS extension to create xUnit project templates using the new xproj project type. It is developed by