aspnet / Tooling

Issue tracker and info on Visual Studio tooling for ASP.NET
Other
256 stars 124 forks source link

Views in class libraries removed from embedded resources under certain circumstances #1058

Closed svallis closed 7 years ago

svallis commented 7 years ago

I have a test repo which should hopefully demonstrate this problem, and I hope this is the correct repo for the issue.

https://github.com/svallis/precompilation-classlib

If you clone and open this solution and perform the following, the issue should be clear. First, the expected results is what happens when adding views to app:

Now perform the same process on lib1:

<ItemGroup>
    <EmbeddedResource Remove="Views\Shared\Test - Copy.cshtml" />
</ItemGroup>

As you can imagine this is highly frustrating during development, and we're constantly running into it while developing features within a library. I don't know if it's an outright bug, or whether we could improve the existing rules in the .csproj for the library. Whatever changes are made to the library project file need to preserve existing functionality though, so that views are not included in the publish output and are embedded in the assembly. This allows everything to work both during development and after publishing with precompiled views.

barrytang commented 7 years ago

To report new issues, use the Report a Problem tool. The GitHub Issue Tracker for the aspnet/Tooling repo is now deprecated in favor of the Report a Problem tool.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks. See here for more details.