csproj

How do I use ASP.NET Core 3.0 types from a library project for shared Controllers, Middleware etc?

痴心易碎 提交于 2020-02-26 07:09:28
问题 While ASP.NET Core up to 2.2 could be consumed through NuGet to create library projects for shared Controllers, Middleware etc, how do I create a library that is able to use ASP.NET Core 3.0 types? While for projects containing views there is a "Razor Class Library" ( razorclasslib ) template, how do I create a library that only contains logic components? 回答1: Applications built for .NET Core 3.0 can reference one or more shared frameworks. ASP.NET Core is one of these shared frameworks

Remove xmlns=“” attribute when adding Reference element into csproj

两盒软妹~` 提交于 2020-01-25 12:21:30
问题 I try to programmatic add the reference of dll into csproj file at time of installation service through the MSI Installer. <Reference Include="TestProject"> <HintPath>..\..\TestProject.dll</HintPath> </Reference> I put below line of source code of add node into protected override void OnAfterInstall(IDictionary savedState) of ProjectInstaller.cs var refnode = xml.CreateElement("Reference"); var attribute = xml.CreateAttribute("Include", null); attribute.Value = "TestProject"; refnode

Is it possible to override or clear the debug path in a dll build with new csproj project file?

浪子不回头ぞ 提交于 2020-01-25 09:25:09
问题 When using dumpbin to view details on my library: dumpbin /headers Test.dll I see that {{FullFolder to Test.pdb}} is the full folder to the pdb. Debug Directories Time Type Size RVA Pointer -------- ------- -------- -------- -------- 95BA9373 cv A1 000199D4 17BD4 Format: RSDS, {4AF64893-BAF4-4FF3-9343-E8D5A55E94FF}, 1, {{FullFolder to Test.pdb}} 00000000 repro 0 00000000 0 Is there a way to exclude this in the csproj file ? My .csproj looks like: <DebugType>full</DebugType> <IncludeSource

Move code file under another file in project

被刻印的时光 ゝ 提交于 2020-01-24 22:25:06
问题 I want to move one code file under the group of another, related file, like here: As you see, SingleObjectViewModel.Commands.cs is hidden in SingleObjectViewModel.cs group. It can be useful in some cases. I've created SingleDocumentViewModel.Commands.cs but simple drag-n-drop in Visual Studio do not work. How to achieve it? 回答1: I found one way of doing this, but it is not user-friendly and needs to edit project file by hands. I'm not sure it will work in other versions of Visual Studio then

Copying a file in .NET Core .csproj file

巧了我就是萌 提交于 2020-01-17 06:35:12
问题 I created a new .NET Class Library project in .NET Core on Mac OS X. During the project build, I'd like to copy a file into the debug directory. How do I add this to the .csproj file? .NET Command Line Tools (1.0.1) Product Information: Version: 1.0.1 Commit SHA-1 hash: 005db40cd1 Runtime Environment: OS Name: Mac OS X OS Version: 10.12 OS Platform: Darwin RID: osx.10.12-x64 Base Path: /usr/local/share/dotnet/sdk/1.0.1 回答1: As with back to .csproj file the MSBuild is used again, this is can

c# - How can I programmatically check that a reference is configured correctly in a solution

丶灬走出姿态 提交于 2020-01-15 03:41:08
问题 We are having some build errors and we need to manually fix the references. I would like to programmatically check that project references are defined instead of dll references: Thus go over all the references in a solution and for each project, check that the references are defined correctly. This way the relevant dependencies will be configured correctly. Does anybody know of an existing solution? I would like a validation tool that will run before the gated check-in. 回答1: I have written

Can I build Xamarin iOS from the csproj only an not use the solution command line

杀马特。学长 韩版系。学妹 提交于 2020-01-13 19:31:40
问题 I have a few apps i want to build inside my solution and I want to build them separately running : /Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool -v build "--configuration:Release|iPhone" ./42.csproj fails. I do see that all of Xamarin examples use a solution file (.sln) with the mdtool, but I am still wondering of there is a way to reference just on project inside my solution. 回答1: Well After talking with xamarin they claim that using mdtool is not recommended. I was told to use

Why does VS 2008 create PDBs for some RELEASE projects but not others?

可紊 提交于 2020-01-13 04:26:07
问题 I have a solution containing several projects that have migrated from VS 2003, 2005, 2008. When compiling all the projects for the RELEASE configuration, VS 2008 creates PDB files for some projects, but not others. Why? In the Build tab of the Properties page for each project, I can see they all have "Define DEBUG constant" unchecked and "Optimize code" checked. When I inspect the CSPROJ for each project, I do not notice any differences that look like they would change this behavior. What

How do I use Powershell to add/remove references to a csproj?

烂漫一生 提交于 2020-01-09 07:18:04
问题 In relation to this previous question I am trying to create a batch file which as part must remove and add a reference to an XML *.csproj file. I have looked at this, this, this and this previous question but as a powershell n00b am unable to get it working (so far). Can anyone help me with the following? I want to remove two specific references in a VS2010 csproj file (XML) and add a new reference. I opened the csproj and the reference can be found at the following location <?xml version="1

Edit the DefineConstants in csproj file

删除回忆录丶 提交于 2020-01-06 17:58:27
问题 I have csproj with the following tag: <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>Bin\Debug</OutputPath> <DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;SUPPORTS_ICLOUD</DefineConstants> <NoStdLib>true</NoStdLib> <NoConfig>true</NoConfig> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> Here if you see that i have added