After Publish event in Visual Studio

UPDATE: seems like in VS 2019 and .NET 5 you can now use Publish target. <Target Name=”Test” AfterTargets=”Publish”> <Exec Command=”blablabla” /> </Target> Here’s my old answer that also works: MS has confirmed, that when publishing to file system they don’t have any target to launch after that. “We currently do not support executing custom targets … Read more

Found conflicts between different versions of the same dependent assembly that could not be resolved

eta: There’s a killer article on this stuff by SO’s own @Nick Craver that you should read While the other responses say this, they don’t make it explicit, so I will…. On VS2013.2, to actually trigger the emission of the cited information, you need to not read the message, which says: C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning … Read more

Is it possible to install a C# compiler without Visual Studio?

Sure, the framework includes a compiler, csc.exe. Look at this article for a quick how-to. The important parts: You can get the command-line compiler (csc.exe) from Microsoft site http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx. Download the redistributable package of the .NET Framework, which includes the compiler and the .NET Framework with C# 2005 syntax support. The compiler is located in … Read more

How can I invoke my MSBuild Target when msbuild.exe starts and when it ends

To execute a solution-wide Before and After targets, you would create two MSBuild project files named “after.<SolutionName>.sln.targets” and “before.<SolutionName>.sln.targets” in the same folder as your solution. To do this on all solutions, you would drop your custom solution-level after targets files into the path $(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportBefore\ or $(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportAfter. When those solutions are built, it will import … Read more

MSBUILDEMITSOLUTION not working with .NET 4?

Set MSBuildEmitSolution=1 and then build from the command line. You should then see a MySolution.sln.metaproj file near MySolution.sln. Notes: If you open a command prompt window, then set the env var via System Settings, you will have to open a new command prompt. You’d think you could also use msbuild /p:MSBuildEmitSolution=1, but you can’t.

npm install -g karma error MSB4019: The imported project “C:\Microsoft.Cpp.Default.props” was not found

For those that still run into errors after installing a VS with Windows SDK and trying Besrl’s solution, in particular node-gyp failing with Error MSB4019: The imported project “X:\Microsoft.Cpp.Default.props” was not found, Try running the npm install commands from a MSVS command prompt. Find it at Start menu > Microsoft Visual Studio 201X > Visual … Read more