Have a .NET Core app that I'm trying to use $(ProjectDir) with and when I attempt to pass in that macro, I get an empty value. I tried what was suggested in Issue 26748846, but that didn't seem to solve my issue.
Pre- Post- Build Event Variables in Visual Studio are Empty
1.9k Views Asked by Jason N. Gaylord At
1
There are 1 best solutions below
Related Questions in .NET-CORE
- NLog with DNX Core 5.0
- How should I reference HttpClient for dnx451 and dnxcore50?
- DNX Core 5.0 library to target any platform. No System.Random class. Workarounds or options?
- Kestrel Running which framework?
- Directory.CreateDirectory not exists in .NET Core
- asp.net dnxcore50 load assembly by file path
- .NET Core doesn't depend on any installation?
- Why is linq to object implementing iterators manually?
- Microsoft Band and WPF
- Determine port in asp.net core
- ASP.NET Core IISIntegration.Tools and .NET Framework
- ANTLR 4.5.3 C# lexer fails to initialize (ATN UUID error)
- Opening Visual Studio 2017 projects in Visual Studio 2015
- dotnetCore (1.0.0-preview2-1-003177) - build warnings as errors - how?
- How to implement interface of C# use COM of native C++?
Related Questions in VISUAL-STUDIO-2017
- No templates in Visual Studio 2017
- Xamarin.iOS on the Mac Server is not compatible
- NuGet Console in visual studio 2017 RC won't Add-Migration or Update-Database?
- VS2017 RC Web deploy - ERROR_CERTIFICATE_VALIDATION_FAILED
- How to use an ASP.NET Core environment variable in testing with Visual Studio
- How to create F# .Net Core ConsoleApp in Visual Studio 2017 RC
- Can I suppress a specific C6031 warning? CString::LoadString
- InterlockedExchange issue with C28112/3
- AppSettings.*.json files not copied on Publish in ASP.NET CORE 1.1
- Does Visual Studio 2017 Community create a Services folder for Dependency Injection with Core 1.0?
- dotnet exec needs a managed .dll or .exe extension while adding Entity Framework Core (1.1.0) Migrations
- project can't be set as Class Library in visual studio
- How to connect with SQL Server database using .NET Core Class Library (.NET Standard)?
- Using Dependency Injection with .NET Core Class Library (.NET Standard)
- Localisation that can be read by a portable F# project (Profile 259)
Related Questions in POST-BUILD-EVENT
- Post build events using relative paths do not work in VS 2013
- Unable to execute a .bat file in post build event command line
- How can I tell if an application is running as a post/pre-build event or standalone?
- $(SolutionDir) in MS VisualStudio Build events
- Post build script to copy all the files from different to output directory
- How do I use msbuild in Visual Studio's post build event?
- How do I add post-build events to InstallShield Limited Edition
- How can I do a post build event in sharpdevelop
- VisualStudion 2012: Post build Events
- Where can we open the `Post-build script` box of a build process template?
- Post event build exit with code 1 error in Visual studio 2013
- zipalign is working manually but failing under Jenkins post build
- TFS 2010 Build Automation and post-build event
- Updating local nuget package on post-build event
- How can I retrieve major/minor/build/revision number on build events
Related Questions in PRE-BUILD-EVENT
- How can I tell if an application is running as a post/pre-build event or standalone?
- IAR Pre-Build batch file python call not working
- npm hangs when called in Visual Studio prebuild events
- Exit Code 216 with SubWCRev
- How do I force Visual Studio 2012 to run a project's pre-build events every time the project is built?
- Update nuget package on a pre build event
- Add custom resource to Silverlight application with pre-build event
- Write a pre-build script to change files from BuildAction Embedded Resource to None in VS 2010?
- Pre and Post Build event parameters
- How to access resources when running app in Visual Studio?
- Build another project by prebuild event without adding reference
- Indirect way to reference "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\datasvcutil.exe" in a prebuild event
- c# Generate c# code before compilation/buil (Like maven plugin in java)
- Run tasks before build in Visual Studio
- How to add commit hash to details of an executable file using GitVersion
Related Questions in BUILD-EVENTS
- Setting the value of a constant or variable at build time
- In a large Visual Studio solution, how can I quickly identify the projects with build events?
- Is it possible to call multiple post-build events in Delphi 2007?
- Can I add a custom "task" to the post-build event of multiple Visual Studio projects?
- Execute exe file or bat file after compile with Visual Studio 2010
- Visual Studio 2019 C++ After Successed Build Run an .exe
- Set BuildAction in Visual Studio from pre build event
- How can I add an existing file to a project in Visual Studio in the pre-build event?
- Prebuild Event only on Build Solution/Project not on F5(Debug)
- Post-build event command line based on project variable
- Post Build event xcopy - exclude some set of files
- Visual Studio 2017 Post Build Event does not generating an error when compiling
- Visual studio to override file on selected build configuration
- How to emulate /p msbuild parameter in Visual Studio build?
- Pre- Post- Build Event Variables in Visual Studio are Empty
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This happens because in .NET Core projects, the pre- and post build macros are set too early and the
$(ProjectDir)property is not yet available. Note that pre- and post build macros are deprecated and should be replaced by proper targets (see https://github.com/dotnet/project-system/issues/1569).A quick fix would be to replace
$(ProjectDir)with$(MSBuildProjectDirectory)\.