Comments (4)
I don't think xunit should be doing that to your projects. VS or TFS or nuget.exe restore
will still restore packages even with this removed. Xunit adding this to your project could actually end up breaking your projects. I'll try to look into this a bit more later.
from automaticpackagerestoremigrationscript.
It turns out that this is not at all specific to xunit.
When you author a package that contains one (or both) of:
build\{packageid}.props
build\{packageid}.targets
For example: BuildPackage.1.0.0.nupkg
build\BuildPackage.props
build\BuildPackage.targets
NuGet automatically adds imports for those files to projects that you install the package into.
<Import Project="..\packages\BuildPackage.1.0.0\build\BuildPackage.props" Condition="Exists('..\packages\BuildPackage.1.0.0\build\BuildPackage.props')" />
<Import Project="..\packages\BuildPackage.1.0.0\build\BuildPackage.targets" Condition="Exists('..\packages\BuildPackage.1.0.0\build\BuildPackage.targets')" />
NuGet also adds an extra target named EnsureNuGetPackageBuildImports
.
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\BuildPackage.1.0.0\build\BuildPackage.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\BuildPackage.1.0.0\build\BuildPackage.props'))" />
<Error Condition="!Exists('..\packages\BuildPackage.1.0.0\build\BuildPackage.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\BuildPackage.1.0.0\build\BuildPackage.targets'))" />
</Target>
This is completely automatic and inevitable.
from automaticpackagerestoremigrationscript.
Does removing the section break xunit?
from automaticpackagerestoremigrationscript.
It doesn't break xunit (or other packages) because the <Import />
elements are left intact.
The only thing EnsureNuGetPackageBuildImports
does is fail the build early and print a friendly message when the files in the <Import />
elements are missing. It doesn't hurt to remove it.
from automaticpackagerestoremigrationscript.
Related Issues (12)
- Cant get this work when its using \s HOT 7
- Remove blank lines at the end of project files
- Doesn't remove <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> HOT 1
- Solution files are saved using the "UTF-8" encoding which cause issues when re-opening them using the Visual Studio Version Selector HOT 1
- Can I specific to a folder
- RedirectionNotSupported ? HOT 1
- out-file is producing two empty new lines at the end of csproj file in fixHintPath.ps1 HOT 1
- vbproj files partially updated HOT 6
- The regular expression pattern ... is not valid HOT 2
- Entry point? HOT 2
- Script doesn't remove <RestorePackages> line from project files. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from automaticpackagerestoremigrationscript.