-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Referencing 3.0 RCL project from 3.0 Web App results in 404 #4332
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
Comments
So investigated this and we're missing some key features from the SDK and NuGet in regards to lifting transitive framework references from packages/projects into the deps.json. The tl;dr; of the issue is we don't end up thinking the Razor class library has a reference to MVC and therefore don't consider it as a candidate MVC assembly to translate into routes/other information. Today we dive over the entire application graph (defined by deps.json) and look at each entries dependencies to see if it references one of MVC's many primary assemblies. If it does, we consider it for View discovery, otherwise we ignore it. This enables us to prevent loading every assembly in the world to enable a fast startup experience. Now that all of ASP.NET is a framework reference when we look at a dependent package/project that only targets a framework reference; we don't see that they're targeting MVC because the deps.json indicates they have 0 dependencies. Example: "Bug4332RCL/1.0.0": {
"runtime": {
"Bug4332RCL.dll": {}
},
"compile": {
"Bug4332RCL.dll": {}
}
}, There are two issues tracking some of the efforts to manifest the understanding of a transitive project/package targeting a framework.
@dsplaisted @livarcocc Is it fair to say these two issues embody bringing FrameworkReference information into the deps.json? @rynowak @pranavkm has this scenario been thought of in this new world of ours where everything is a framework reference? Were there other plans to fix this or was the plan to just wait for fixes from other teams? /cc @natemcmaster |
Talked with @rynowak offline and his suggestion was to remove our filtering logic of "is a candidate MVC assembly". Main motivation behind this is now that ASP.NET is a framework reference we greatly limit the number of dlls we need to inspect. I'll give this a shot and work with @sebastienros to see what startup impact it has. |
The NuGet issue is to reference FrameworkReferences in the assets file. I don't think we have plans to represent them in the deps file, though we could consider that if necessary. |
Ah, ok. In regards to our requirements if i'm able to get by without needing the deps.json then we shouldn't need that. I'll keep this issue up-to-date |
…ared framework. - This is required due to how AspNet Core is included via a framework reference now. In order to properly evaluate transitive projects that target AspNet Core 3.0 we'd need some level of information that they targeted a framework reference. This happens to be a missing feature in the sdk/nuget. Also, given that all of ASP.NET is now included via a framework reference the act of finding candidate assemblies to reduce the amount of assembly loads doesn't matter as much since we went from 100s of potential assemblies to only what the application currently targets. - Fixed a test issue where calling into BasicApi tests resulted in the attempted loading of EFCore.Design. Problem is EFCore.Design wasn't a dependency of our functional test project because of PrivateAssets="true" and therefore, when we tried to find candidate assemblies we read in the BasicApiTest.deps.json but operated on the functional tests.deps.json. I could have added the EFCore.Design package to the functional test project to fix this but given that the package wasn't being used choose to remove it instead. - Removed Mvc.Analyzers from AspNetCore.Mvc because it's no longer brought in via the shared framework. This was needed because with the new approach with always loading all dll's in an applications graph we'd attempt to load Mvc.Analyzers at which point we'd explode saying we couldn't load Roslyn (it's not available at runtime anymore). - Updated tests to reflect new expectations in regards to application part type loading. Addresses #4332
Alright, so we tried to scan the whole world and ran into a ton of issues. Most importantly our perf got destroyed:
Sooo, that being said @dsplaisted / @livarcocc we'll need a transitive package/project framework reference to exist in the deps.json. I'll send an email out so we can talk more. |
Marking as blocked until dotnet/sdk#2729 is completed. |
Moving out to preview4 as the dependent work hasn't yet completed. |
Talked to @nguerrera and @livarcocc regarding this. The dependent work will be available in 3.0.0-preview5 and this work will be unblock then. |
Lots of 3.0 talk going on here. Is this also going to get fixed in 2.2 or is that a dead branch? My problem #10331 happened on 2.2. |
@ghstahl we will usually consider targeted fixes for 2.1 \ 2.2. Unfortunately the approach we took to fix this issue incurred a fairly substantial change so porting it the change as-is wouldn't be an option. |
Please note, in my experience using The workaround described here to use the sample |
Hi @ebekker. The was fixed in a way, which doesn't require the parts discovery workaround any more. There were some follow-up issues we had to address during Preview 7 release, specific to the new model. Can you please be more specific what is the exact problem you're having? |
If my ASP.NET Core web project just references an RCL library that contains a Razor Page, if I try to reference the page using the path that is either "implied" by the Page's directory path (e.g. If however, I also add the If you would like, I can provide a reference to a sample project. Or perhaps I should wait till preview 7 to retry my scenario. |
@ebekker could you please file a new issue and share a repro app? |
This seems to be happening still, at least on Mac, easy repro:
|
Forget it, this is due to the MVC project not having the correct |
@ebekker Add30AssemblyWorkaround didn't work for me. Could you please share a reference to the sample project? Thanks in advance. |
Describe the bug
Add a Razor Class Library(RCL) and reference from Web App 3.0, then run the project got 404 error.
To Reproduce
REPRO STEPS
Hello World
A 404 error page shows up.

Expected behavior
The page loads just fine
Screenshots
Additional context
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/738297
The text was updated successfully, but these errors were encountered: