-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow dotnet pack to pack nuspec file without needing a csproj file #4254
Comments
closing this as a duplicate of : #4250 |
I don't think these are duplicates. #4250 is about issues packing with csproj + nuspec. This one is about packing nuspec without a csproj file. |
aah i see, i don't think this will be accommodated in 4.0-RTM as you need a way of getting the Pack targets imported so dotnet pack can work properly - which is why we have a requirement of having a dummy csproj right now |
pending NuGet/Home#4254. Without this, we have no way to create a NuGet package that doesn't contain a package reference to Microsoft.DotNet.Cli.Utils, preventing a proper repro of https://github.com/dotnet/cli/issues/4214.
pending NuGet/Home#4254. Without this, we have no way to create a NuGet package that doesn't contain a package reference to Microsoft.DotNet.Cli.Utils, preventing a proper repro of https://github.com/dotnet/cli/issues/4214.
Same issue there. But if possibile can be done like csproj instead of nuspec? One thing less to learn. For me is not an issue use a csproj instead of nuspec who can Maybe we can use the csproj, but the |
@enricosada you can use |
To see a list of all possible scenarios in dotnet pack, refer to : https://github.com/NuGet/Home/wiki/Adding-nuget-pack-as-a-msbuild-target |
For a little more context: the scenario I have in mind is that we produce some custom nuget packages with layouts that are hard to achieve using csproj, or even some packages that don't come from a .NET project at all. |
@natemcmaster using a csproj like <Content Include="files/SQLite.props">
<PackagePath>build\net45\</PackagePath>
<Pack>true</Pack>
</Content> doesnt work? i can set |
Yes, that would work for that specific example, but why should I need a csproj when I'm just packing things? I'm not compiling C#. |
You need a way to import the pack targets, and that is being achieved by having a csproj that does that for you. |
|
thx @rohit21agrawal works, using <IncludeBuildOutput>false</IncludeBuildOutput>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> and
generate the nuspec, with no compile and no dependencies (i dont need these) |
Just wanted to follow up in this thread, I too would like a way to pass in the nuspec directly with the option to pass in command line nuspec properties. Is something like this in the pipeline?
Could a default pack.targets file be imported if a nuspec file is passed on the command line? This would ensure that the right targets would be imported in the case of both csproj and nuspec files. |
We should allow
|
+1 We create our own nuspec from a csproj to tell other dependencies and set other dependency versions |
+1 |
Hi friends, As you may have seen, we've tagged this issue as a potential item for this year. I know there have been a number of "+1s" and 👍, but we need some more help. If you can give us a quick comment on how this functionality will help your scenario if it's not already listed(installers, re-packing, templates, wrapper packages, repository migration from nuget.exe to dotnet CLI, etc) that would be especially helpful. The more the merrier. |
You don't need to have a project file to pack MSBuild SDK and Extension packages if they don't need to have compiled code. Having project files in this scenario just complicates things...! |
This would help us in 3 ways:
Non-choco:
|
We are distributing |
As described here: #4254 (comment) I have a backend asp.net project and a frontend vue project. I pack the frontend in a single nuget package via a CI/CD pipeline that only needs to contain content files (html/js/css). The backend project uses this package to serve the files from With .net 4.x I could just use Now my frontend is build in a linux docker container with |
I have a CI/CD system that dynamically produces NuGet packages, and we don't want to modify CSPROJ files! |
We have 3rd party software that is made available only as .dlls. Currently we use nuget.exe to package them as nuget packages and reference them in our projects. |
My scenario is that I want to build a single analyzers NuGet package that targets multiple versions of Roslyn. It needs to contain As far as I can tell, the authoring experience (mentioned in dotnet/sdk#20355 (comment)) for this scenario still has not [yet] been implemented. I threw together some PowerShell scripts that fit my needs, including one to build a NuGet package from a .nuspec file: https://gist.github.com/csdahlberg/56e482c6ab28f93680bef3879c6473b0 |
Just an FYI to the people in the thread who say they want to just use the It's not perfect, I'm not proposing this as a "solution" to avoid implementing the proposed feature. I'm just saying that using features that have been shipping for multiple years, it's possible to pack a nuspec using only the .NET SDK CLI. It can be scripted by running |
In our case, we have used nuget pack to create packages without requiring a csproj file. We have close to 100 repositories doing this way. As we are looking into the new mariner docker 2.0 image, we found mono is required to make it work. However, mono is not available. Our repositories are mainly Python based and for AI & Machine learning, the production system requires shipping the artifacts through nuget format. Having every repository creating a dummy csproj is a non trivial task. Bringing back a previously function which worked before and for a large set of cases is highly desirable. We tried above approach suggested by @zivkan above and it didn't work. |
sounds like a perfect opportunity to create an which also would allow dotnet/nuget team to continue killing |
Removing |
not really no. nuspec is inherently bad if you try to integrate your build system with msbuild the remaining issue is bundling static content like raw dll for example. as per my first sentence, getting a an in all that a nuspec is not / was not / would not be necessary to exists |
Correct me if I'm wrong but I think the Maybe someone can tell if the creation of the But I agree. There shouldn't be a dedicated Just one thing I would like to mention. I use the replacement tokens ( With With dotnet core and a
The Or just allow to directly use properties instead of the replacement tokens in a nuspec file. So
Could be rewritten to
|
Why not one of the existing:
https://learn.microsoft.com/en-us/nuget/create-packages/creating-a-package-msbuild |
this message above is why I mentionned there's already some MSBuild integration in place with The fact that internally it generates a data model in shape A or B (and/or a
What's needed is a way to "arbitrary pack" ... "stuff" like static content / raw file / etc ... The benefits of that would be to have that included in Visual Studio ... directly "as a project" for example and just like it's already working today, having an That's what my many post above are trying to point out. moving back to The issue with nuspec is that it require dedicated tooling/toolset to automate fields change inside I'm hinting at a solution that would somehow be in the middle of as you can see: and as many mentionned it, since it's about not calling C# SDK / .... <Project Sdk="SomethingSomething.Nuget">
</Project> |
@tebeco What he said!!! |
Maybe you don't want to depend on NuSpec when you're building from a project file but that's our preference and not a requirement for the design of the package under the hood. May be we can abstract it away using an MSBuild SDK like I did (e.g., |
We have third party native dlls that we want to pack as nuget. Installing the nuget adds copying the dlls to output on build. I don't need csproj for that. I was sure I can pack a nuget from nuspec with |
Guess this is still not possible? |
Follow up to #3904 (comment)
Scenario:
I want to pack a nuspec file in an x-plat build system.
Inputs:
NB: I am not packing a csproj, just files.
In <= 4.0.0-rc2, this was available as
dotnet nuget pack (nuspec)
file. This was removed in 4.0.0-rc3 NuGet/NuGet.Client#1065 without a suitable replacement.More data to consider:
cc @emgarten @rohit21agrawal
Please 👍 or 👎 this comment to help us with the direction of this feature & leave as much feedback/questions/concerns as you'd like on this issue itself and we will get back to you shortly.
Thank You 🎉
The text was updated successfully, but these errors were encountered: