csproj

Error HRESULT E_FAIL when pasting references in Visual Studio

家住魔仙堡 提交于 2019-12-01 15:35:34
问题 I know this isn't a programming question but it is a programming tool question. In Visual Studio 2008 Team Edition (version 9.0 with .NET 3.5 SP1) when I copy and paste references from one csproj to another (with the context menu in the 'Solution Explorer' view) I get the following error: Error HRESULT E_FAIL has been returned from a call to a COM component This has only just started happening on my machine. I can only find this article about it, and it contains no solution. Any ideas? 回答1:

Visual Studio keeps adding property to my csproj. Why?

▼魔方 西西 提交于 2019-12-01 15:27:48
I'm using Visual Studio 2012 RC to work with my C# solution. All my configuration-specific settings are stored within a single .props file which is then included by all my .csproj files. Yet VS insists on putting this right in front of the include: <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> <IntermediateOutputPath>C:\Users\xyz\AppData\Local\Temp\vs855E.tmp\Debug\</IntermediateOutputPath> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> <IntermediateOutputPath>C:\Users\xyz\AppData\Local\Temp\vs855E.tmp\Release\<

multiple hint paths in csproj file from an text file variable

烈酒焚心 提交于 2019-12-01 10:48:39
Context : In our application there two separate dlls which are repositories of variables configured for different types of hardware .These dlls has same name and is referenced from our application, Now every time if we wanted to test the different type of hardware we have to copy the relevant dll to the location where application is running. I am looking for a workaround. References : I have seen the following threads , 1) .csproj multiple hint paths for an assembly 2) https://whathecode.wordpress.com/2012/10/07/conditional-project-or-library-reference-in-visual-studio/ Question: Can i declare

Embedding C# sources in PDB with new csproj

旧城冷巷雨未停 提交于 2019-12-01 06:52:54
The recently-released .NET tooling seem to have support for embedding C# in PDBs , which should improve the experience of stepping into third-party, etc. Running csc /? , I can clearly see the /embed option: "Embed all source files in the PDB." However, there doesn't seem to be any way to specify this in csproj. What's more, there doesn't seem to be any provisions for passing arbitrary switches to the compiler, which I would use to manually pass /embed. Can anyone confirm that I haven't missed anything and that build support for /embed is currently lacking? Is there an issue for this (and if

Embedding C# sources in PDB with new csproj

耗尽温柔 提交于 2019-12-01 06:06:21
问题 The recently-released .NET tooling seem to have support for embedding C# in PDBs, which should improve the experience of stepping into third-party, etc. Running csc /? , I can clearly see the /embed option: "Embed all source files in the PDB." However, there doesn't seem to be any way to specify this in csproj. What's more, there doesn't seem to be any provisions for passing arbitrary switches to the compiler, which I would use to manually pass /embed. Can anyone confirm that I haven't missed

The file could not be added to the project. This file is within the project directory tree error

拈花ヽ惹草 提交于 2019-11-30 23:14:12
问题 Whenever I try to add a file to my Visual Studio project, I get the following warning: The file [filename] could not be added to the project. This file is within the project directory tree How do I fix this error? 回答1: Go in to your Windows File Explorer and navigate to the .csproj file and open it with Notepad (or advanced text editor like NotePad++) You will notice two lines that have similar or duplicate Compile Include lines: <Compile Include="..\ProjectDir\SubDir\MyClass.cs"> <Link>

How to read property value from external file?

倾然丶 夕夏残阳落幕 提交于 2019-11-30 18:28:15
I have AssemblyInfo.cs file automatically generated during build. Here's part of .csproj file: <PropertyGroup> <Major>2</Major> <Minor>3</Minor> <Build>0</Build> <Revision>0</Revision> </PropertyGroup> <Target Name="BeforeBuild"> <SvnVersion LocalPath="$(MSBuildProjectDirectory)" ToolPath="C:\Program Files\VisualSVN Server\bin"> <Output TaskParameter="Revision" PropertyName="Revision" /> </SvnVersion> <AssemblyInfo CodeLanguage="CS" OutputFile="$(MSBuildProjectDirectory)\Properties\VersionInfo.cs" AssemblyVersion="$(Major).$(Minor).$(Build).$(Revision)" AssemblyFileVersion="$(Major).$(Minor).$

How to get rid of StyleCop

半腔热情 提交于 2019-11-30 17:53:35
Someone on our team installed StyleCop and since then all of the projects he loaded up and committed to source control refuse to load unless stylecop is installed. I know I can manually edit the .csproj files to get rid of it, but is there an easy way to automatically remove these stylecop parts from the project files so they can be loaded and built on a non-stylecop-infected Visual Studio machine? I disabled StyleCop by adding the following GlobalSettings configuration to the file settings.stylecop in the solution root. <StyleCopSettings Version="4.3"> <GlobalSettings> <BooleanProperty Name=

How can I use BeforeBuild and AfterBuild targets with Visual Studio 2017?

和自甴很熟 提交于 2019-11-30 12:02:25
After upgrading to a csproj to use Visual Studio 2017 and Microsoft.NET.Sdk, my "BeforeBuild" and "AfterBuild" targets are no longer running. My file looks like this: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net46</TargetFramework> </PropertyGroup> <!-- my targets that don't run --> <Target Name="BeforeBuild"> <Message Text="Should run before build" Importance="High" /> </Target> <Target Name="AfterBuild"> <Message Text="Should run after build" Importance="High" /> </Target> </Project> The associated MSBuild git issue recommends not using BeforeBuild/AfterBuild as

Conditional Content Based Upon Configuration

☆樱花仙子☆ 提交于 2019-11-30 08:35:15
I've tried several times to use a similar technique as "conditional references" for conditional content. Content entries in the Visual Studio Project file such as "web.config" I do not want included when I publish the website. I've tried a few things like... <Choose> <When Condition="$(Configuration) != 'Release'"> <ItemGroup> <Content Include="web.config"> <SubType>Designer</SubType> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> </When> <Otherwise> <ItemGroup> </ItemGroup> </Otherwise> </Choose> But this doesn't work. Any ideas? Or have you encountered this