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
- Repository manager receives the wrong connection string in .net core
- How can I overwrite the localization strings in a library
- Custom type resolution
- How to enable log to console Cosmos Client SDK requests
- Issue with Entity Framework Core: .Include() and .AsNoTracking() not displaying expected related entities
- Using Python CDK to bundle dotnet 8 code to AWS Lambda function
- How to make Visual Studio 2022 project launch Windows Terminal instead of PowerShell?
- Custom Metrics stop saving in App Insight after one hour
- How to send select input data for form submission?
- When I use built-in DockerFile in Visual Studio, I see no errors, but when I try to create image and container using terminal I get an error
- Failure to Execute the DBCommand: SQLite Err. 1 - C# / .NET / Entity Framework Core
- KeyCloak Handshake causing timeout
- problemas con los CORS en .net core 7 y angular 15
- Access Registed Scoped Services and Transient Services using GetService()
- .NET Core DB vs JSON model design
Related Questions in VISUAL-STUDIO-2017
- file download method in visual studio 2017
- Icons for Visual Studio 2017 Solution Explorer file types
- How can I remove a lib file from "Commandline" in VS2017?
- How can I get cascading reference dlls in one project to build into my main website project?
- Qt Addin: Attempt to add newer Qt version "There's no Qt version assigned to project"
- Alternative for nextafter when backporting to visual studio 2013
- Switch. case var b when b.Contains("SomeString"): Won't compile
- simple openmp c++ problem when using for loop
- How to forbidden trotoiseMerge in Vs2017 use the built-in merge tool
- How to change Visual Studio 2017 default Window layout in C++ sytle?
- Run SSIS package through Server its working fine but that package I am running on my local system its not working
- Unable to launch the IIS Express Web server in vs 2017
- Error in displaying the Extension in SSMS created in Visual Studio (VSIX project) when right clicking any tables
- Visual Studio 2017 (or higher) configure IDE to use MetadataAsSource folder under project build folder and not in AppData\Local\Temp
- I can't understand C2665 error (VS 2017 / 15.9.58)
Related Questions in POST-BUILD-EVENT
- How do I generate the swagger file, swagger CLI isn't supported with .net 8
- Error: "MSB3073 The command "dotnet swagger tofile --output swagger_v1.json bin\Debug\net6.0\TestSwaggerGenWithDotnetSix.dll v1" exited with code 1."
- What is the right way to move references around in my output folder?
- How to get the compiler version in a post-build event?
- Why can't I see the commit hash of my application in a post-build event?
- Visual Studio post-build event macro of EditBin not working
- Getting Version Number in GitHub Actions for a .Net Maui App
- What is wrong with this Postbuild event command?
- Multiple post-build events in Visual Studio 2022
- How to get target directory of other project under same solution fo post build action of project (VS C#)
- Getting 'exited with code 9009' when trying to copy files via post build event - VS 2017
- How to make an error in a Visual Studio post-build event make Visual Studio consider the build as failed?
- PostPublish.bat file works when called using Command Prompt, Throwing error when called as a Post Publish Event
- Trigger another jenkins Pipeline B after success of jenkins pipeline A
- Why does the post-build event not cd?
Related Questions in PRE-BUILD-EVENT
- NET Core - Partial class created during the build process, is only used from the second run onwards
- Generating designer.cs code class for a DBML file using Pre build event in Visual Studio 2022
- Commands from bat file is missing
- Getting Version Number in GitHub Actions for a .Net Maui App
- Multiple post-build events in Visual Studio 2022
- Make CMake update header file before building
- pre build event with if condition
- Upserting using Coda Pre-built Function in Pipedream
- Include source files generated by prebuild-event
- Accessing changed files for a pull request in pre build script before executing GitHub actions
- How to add commit hash to details of an executable file using GitVersion
- Run tasks before build in Visual Studio
- Visual Studio project dependancy question
- Setting up requirements.txt in prebuild gitpod.yml
- All Pre-Build event commands fail with exit code 1
Related Questions in BUILD-EVENTS
- Multiple post-build events in Visual Studio 2022
- How to use powershell support for Build Events in VS2019
- In Visual Studio/msbuild, how can one target framework's build event depend on another's?
- Visual Studio 2019 Windows SDK executable path macro has multiple paths
- How to embed a file or text to c# project dll at build time in visual studio?
- Set BuildAction in Visual Studio from pre build event
- Visual Studio 2019 C++ After Successed Build Run an .exe
- How to do REST api call on build event
- Visual studio to override file on selected build configuration
- How to append build version to end of the output exe file name in console appilication with using post build event?
- How to suppress initial post-build event error in Visual Studio 2017 (C#)?
- How can I add an existing file to a project in Visual Studio in the pre-build event?
- Post-build event command line based on project variable
- Visual Studio 2017 Post Build Event does not generating an error when compiling
- Visual Studio 2017 - User Macro for Build Event
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 # Hahtags
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)\.