In MSBuild for Asp.Net Core use /p:OutputPath parameter, not /p:OutDir nor both.
We’ve used psake powershell build for ASP.Net
4.61 project and passed both parameters
msbuild /p:OutDir=“$binariesDir\” /p:OutputPath=“$outPath\”
Actually /p:OutputPath was ignored(almost, see below) and build was saved to specified in /p:OutDir folder.
When I included Asp.Net
Core project into solution, it’s failed because dll, referenced by the Core project, was saved to OutDir folder, but Asp.Net
Core project tried to find it in OutputPath folder.
I’ve tried to remove /p:OutputPath
parameter (as suggested in OutputPath vs OutDir
thread: “to keep the
that is generated by Visual Studio, then set the OutDir as a command argument”), Asp.Net
Core project failed because dll was saved to OutDir folder, but Asp.Net
Core project tried to find it in relative bin\Release\
When I removed OutDir parameter and specified /p:OutputPath=“$binariesDir\” build was successful, but package for MSDeploy, specified in a custom MS Build step, was created in a relative path obj\Release\Package rather than specified $binariesDir folder, so I needed to adjust package path.
Note that previously MSDN recommended the opposite: “OutputPath has been deprecated and OutDir should be used instead whenever possible. ”
Fakes related code
Furthermore, these constants seems defined in VB only, and not in c# and not updated since VS2008.
The reasons are discussed in “Pre-defined Constants, preprocessor directives, etc… “
The “C# Language Designers” decided to not include constants in the fashion in which C/C++ allows them. To allow some, or even one, would open a Pandora’s Box of voices suggesting new constants to be added.
But I disagree, because if the limitation coming from VS , it should provide a way to determine it in pre-condition.
The related article shows how to check installed Visual Studio on run-time
Unfortunately I didn’t find, is it possible to determine Visual Studio edition during c# compile time?
On new Windows 10 machine with Visual Studio 2015 installed when I tried to build my solution from batch file, I’ve got an error
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(2769,5): error MSB3086: Task could not find “s
gen.exe” using the SdkToolsPath “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\” or the regis
try key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86”. Make sure the Sdk
ToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Mic
rosoft Windows SDK is installed
suggested to Install Microsoft Windows SDK for Windows 7 and .NET Framework AKA v7.1.
But I’ve got error: Windows SDK Setup
Some Windows SDK components require the RTM .NET Framework 4. Setup detected a pre-release version of the .NET Framework 4. If you continue with Setup, these components will not be installed. If you want to install these components, click Cancel, then install the .NET Framework 4 from http://go.microsoft.com/fwlink/?LinkID=187668 and then rerun Setup.
The message is misleading, because I have .net framework 4.6, but I Tried to install the .NET Framework 4 from https://www.microsoft.com/en-us/download/details.aspx?id=17851
I’ve got expected message:
Same or higher version of .NET Framework 4 has already been installed on this computer
I’ve tried different suggestions trying to change path and properties in Microsoft.Common.targets, but finally gave up and
Copy sgen.exe, al.exe and al.exe.config from C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\
to C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\
as suggested at http://stackoverflow.com/questions/4923131/task-could-not-find-al-exe-using-the-sdktoolspath
I was trying to move a few directories from one repository to another and answer http://stackoverflow.com/a/17867910/52277 suggests to use
git filter-branch –index-filter ‘git rm –cached -qr –ignore-unmatch — . && git reset -q $GIT_COMMIT — apps/AAA libs/XXX’ –prune-empty — –all
I’ve put the command into batch file and got the error
> fatal: bad revision ‘rm’
The same error happened for an example from git documentation https://git-scm.com/docs/git-filter-branch
git filter-branch –index-filter ‘git rm –cached –ignore-unmatch — buildMaster.bat’ HEAD
However when I was running the command in git bash, it didn’t show any error and worked successfully.
It was acceptable for me. But I am still curious why including inside .bat cause an error with unclear message
I needed to insert new line after existing one in multiple similar xml files.
In Visual Studio open “replace in files” dialog and tick “use regular expression”
In “find” escape “/” as “\/”
<param name=”ExistingKey” value=”(.*)” \/>
In “Replace” repeat original string, then add n and add a new string
<param name=”ExistingKey” value=”$1″ />\n <param name=”NewKey” value=”new value” />
I noticed that I often do the same sequence of git commands.
spa = !git stash && git pull && git stash apply
I’ve created .bashrc with command
and added the following
git stash apply
Now I can use just the name in git bash