-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Nuget Msbuild does not respect excluding TypeScript generated content based on csproj setting. #2166
Comments
From @jainaashish on August 24, 2017 22:13 @rohit21agrawal can you take a look at it? Thanks! |
can you try setting |
From @rjamesnw on August 25, 2017 1:25 That worked!!! Thanks. ;) I assume though this is just a work-around, since one day I might need to add content and this will be a problem again. For now, it solves my problem. |
is it possible for you to just attach a repro project? it will make it much easier to investigate |
From @rjamesnw on August 25, 2017 2:49 After build, open the obj\ClassLibrary1.1.0.0.nuspec file see what I mean - but I'm guessing you know that already lol. ;) |
From diag logs:
|
CC: @natemcmaster |
In this case the TypeScriptCompile task is adding the generated items to the Content itemgroup without checking the initial state of the content glob. To fix this in this task, an issue can be filed here - https://github.com/microsoft/typescript/issues When the below is added to the csproj, it only removes the contents that are present at that time. In this case the generated contents are added later.
MsBuild does not support dynamically evaluating these items during build, pack, publish etc (https://github.com/aspnet/websdk/issues/164) To fix this, you should be able to add this to the csproj
|
As I sort of suspected in my original post. Glad to know there's a workaround! ;) |
This issue is being closed because it has not been updated in 3 months. We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate. |
- Log from inside of HubConnectionContext if the user callback failed. - Use ThreadPool.QUWI instead of Task.Factory.StartNew. - Remove try catch from HubConnectionHandler
From @rjamesnw on August 24, 2017 7:28
Details about Problem
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
VS 2017 Community
NuGet version (x.x.x.xxx): N/A (in msbuild)
dotnet.exe --version (if appropriate): 1.1.0
VS version (if appropriate): 15.3.2
OS version (i.e. win10 v1607 (14393.321)): Win 10
Worked before? If so, with which NuGet version: First time trying
Detailed repro steps so we can see the same problem
Create a .Net Core C# library.
Edit the csproj and set this:
<Project Sdk="Microsoft.NET.Sdk.Web">
WHY? Because this allows compiling (to catch errors) and embedding cshtml files while also creating a library file, and it works great.
# 2 causes the project to reload. Open project settings and set Output Type to "Class Library".
Enable "Generate NuGet package on build" in the project settings under "Package".
Create default tsconfig.json. I had something like:
Create a .ts file.
Enter "var n = 1;" in the .ts file so it has content. On save it should compile (make sure).
Build, and observe the .json files included in
obj\{YOUR LIBRARY}.nuspec
.Add this to csproj:
Output Issue Example
Other suggested things
I think that the TypeScript compiler is updating the files and causing msbuild Nuget integration to pick them up, since the build action is
buildAction="Content"
, when in fact the content should be removed.Verbose Logs
I don't know how to do this, but the project is easy to create, so you can easily do this yourself when checking it out.
Other Comments
This is the issue I am having with another very large project of mine. This has been working perfectly for months, since the web project and libraries were in the same solution, and it compiled and ran the ASP.Net Core MVC project perfectly. I decided to separate the libraries into a separate solution and have packages created for Nuget, but these content files are getting in my way, and also causing build errors when including the packages in other projects. The only work-around is to open the package in the NuGet Package Explorer and remove them manually, but it is easy to forget and very annoying to have to do this on EVERY build.
Copied from original issue: NuGet/Home#5801
The text was updated successfully, but these errors were encountered: