csproj

How do I run app.config transformation task first before the PostBuildEvents?

只愿长相守 提交于 2020-01-04 06:45:50
问题 I have a console application that uses a database connection string which is defined in app.config. I have a few transformations to change the string depending on the build configuration. I also have a few post-build events that copy app.config to other projects output. The problem is post-build event fires first and I copy the untransformed app.config. Later the transformation task kicks in and apply the transformation (so I know it works). I use with Visual Studio 2010 and .NET 4. Right now

Hide files in .csproj without excluding them from build

五迷三道 提交于 2020-01-04 04:05:09
问题 Is it possible to hide files/folders in .net core csproj without excluding them from build? I have a folder containing generated files which I would rather see they are not visible inside Solution Explorer in Visual Studio. 回答1: You can set the Visible="false" attribute on the items. For an SDK-based project (.net core / asp.net core templates), you could add e.g.: <ItemGroup> <Content Update="**/*.css" Visible="false" /> </ItemGroup> Depending on your project type (=> defaults), you might

Which one is correct approach for assembly reference in csproj file?

久未见 提交于 2020-01-03 17:20:54
问题 In my one of the MSI Installer I am updating the assembly and project reference relative path pro-grammatically.My all reference assemblies inside my application folder. I try to implement both the path relative and absolute path. Both are working fine. Relative Path <Reference Include="log4net"> <HintPath>..\..\..\..\log4net.dll</HintPath> </Reference> Absolute path <Reference Include="log4net"> <HintPath>C:\Program files\Myapplication\log4net.dll</HintPath> </Reference> I have only seen

“Bogus” Web project requires missing web component message for razor

久未见 提交于 2020-01-02 05:23:14
问题 Using Visual Studio 2010, MVC 3 (release version) I'm getting this error when opening a specific project which was a traditional web forms project to which I've added MVC: "The Web project '' requires missing web components to run with Visual Studio. Would you like to download and install the using the Web Platform Installer now? ASP.NET Web pages with Razor syntax." I have MVC installed and fully running. Other pure MVC and another mixed Web Forms/MVC project open without any issue. Clicking

not able to build in clearcase snapshot csproject

自闭症网瘾萝莉.ら 提交于 2020-01-01 19:43:15
问题 I am using clear case as my source control and i have snapshot view of all my projects(C#) . Some of the common projects are shared among them. Now i have 5 projects in my solution and they have clear dependencies among them (No circular dependencies) . Project 5 refers to the project 4 i have build project 4 successfully and project 5 could not found referred dll on its location . But when i see it physically it is there. Now the problem here is when i try to create a new snapshot view and

`visual studio 2017 add as link content files (aspnetcore)

时光毁灭记忆、已成空白 提交于 2020-01-01 06:46:29
问题 Since VS2017 returned to csproj, I am again able to add files "as link"... NOT! When I link a file I also want it to be copied to the solution folder (not output directory, just solution), for example js files, webpack config files etc, I have them shared and "linked". But in order for these to be really "seen" by visual studio, I have to copy them to the solutions. I do this in a BeforeTargets="Build" event in the csProj file. That is how I did it before the project.json change (during the

Transforming .csproj using nuget package

我是研究僧i 提交于 2020-01-01 05:29:05
问题 I know it is possible to transform source code files and config files using a custom Nuget package. Unfortunately I cannot find anywhere on how to be able to append to or change a .csproj file. Is this possible? 回答1: The only file modifications that are directly supported in NuGet without resorting to PowerShell are: web.config and app.config transforms. You can add files from your NuGet package into the project, but they will overwrite the existing files. The files added can also be

How can I prevent external MSBuild files from being cached (by Visual Studio) during a project build?

走远了吗. 提交于 2019-12-31 10:42:00
问题 I have a project in my solution which started life as a C# library project. It's got nothing of any interest in it in terms of code, it is merely used as a dependency in the other projects in my solution in order to ensure that it is built first. One of the side-effects of building this project is that a shared AssemblyInfo.cs is created which contains the version number in use by the other projects. I have done this by adding the following to the .csproj file: <ItemGroup> <None Include=

How can I prevent external MSBuild files from being cached (by Visual Studio) during a project build?

China☆狼群 提交于 2019-12-31 10:41:38
问题 I have a project in my solution which started life as a C# library project. It's got nothing of any interest in it in terms of code, it is merely used as a dependency in the other projects in my solution in order to ensure that it is built first. One of the side-effects of building this project is that a shared AssemblyInfo.cs is created which contains the version number in use by the other projects. I have done this by adding the following to the .csproj file: <ItemGroup> <None Include=

MSBuild. Create EmbeddedResource before build

五迷三道 提交于 2019-12-31 04:46:06
问题 I want to embed local references in the assembly before compiling the main unit. But the written target does not work. <Target Name="EmbedLocal" BeforeTargets="CoreCompile"> <Message Text="Run EmbedLocal for $(MSBuildProjectFullPath)..." Importance="high"/> <ItemGroup> <EmbeddedResource Include="@( ReferencePath->WithMetadataValue( 'CopyLocal', 'true' )->Metadata( 'FullPath' ) )"/> </ItemGroup> <Message Text="Embed local references complete for $(OutputPath)$(TargetFileName)." Importance=