-
Notifications
You must be signed in to change notification settings - Fork 252
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
Packed contentFiles are included as source code even when they're some other form of content #5024
Comments
@gulbanana can you paste your generated nuspec ? (you can find it in the obj folder) |
Here is the generated nuspec:
|
The original project file:
|
I'm also experiencing this issue. The files appear in Visual Studio as expected, but if I look in project.assets.json, all my PowerShell files are listed with "buildAction": "Compile", and not "None", as specified in the nuspec. When I build the project, the C# compiler tries to build the PS scripts, and that ends in tears. Installing the package and building with the dotnet CLI and VS both yield the same result.
> dotnet --version Visual Studio 2017 |
@paulinfrancis can you make sure you've the right package folder structure in project before packing this nuspec, which is |
@jainaashish either should work - you can either have the convention based folder structure or use the files tag to include files and then also add them as contentFiles |
also, that nuspec is the one which was generated (incorrectly) by nuget packtasks. it wasn’t hand written. |
@jainaashish I've done another test, and the same behaviour as previously mentioned is exhibited; the C# compiler tries to compile the PowerShell scripts.
@rohit21agrawal I was also under the impression that files and contentFiles aren't mutually exclusive, and that they serve separate purposes. |
What does the generated nuspec file within the nupkg look like? |
EDIT: So I can see that the contentFiles node is missing. I generated the nuget-package with the nuget package explorer. I have just tried generating the package using nuget.exe pack foopackage.nuspec. The nuspec within the package now contains the contentFiles node, but the behaviour in VS is still the same; the C# compiler tries to compile the ps1 scripts. |
@paulinfrancis please paste the foopackage.nuspec file and the nuspec file that was generated within the package. |
I've got an sdk project for building a nuget package which includes this section:
The goal is to provide typescript definition files to consumers of the package. I don't want them to be compiled as C# files, and the item isn't of type Compile.
The generated package contains the content files at the specified path. However, when my package is referenced by some project, it tries to compile the files with csc.
The text was updated successfully, but these errors were encountered: