Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

CandidateAssemblies should always include the entry assembly? #4318

Closed
javiercn opened this issue Mar 20, 2016 · 14 comments
Closed

CandidateAssemblies should always include the entry assembly? #4318

javiercn opened this issue Mar 20, 2016 · 14 comments
Assignees
Milestone

Comments

@javiercn
Copy link
Member

Scenario, I'm running MVC Sandbox and I get a 404 on startup.

Default assembly manager does this:
https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Core/Infrastructure/DefaultAssemblyProvider.cs#L75

        public IEnumerable<Assembly> CandidateAssemblies
        {
            get
            {
                if (_dependencyContext == null)
                {
                    // Use the entry assembly as the sole candidate.
                    return new[] { _entryAssembly };
                }

                return GetCandidateLibraries()
                    .SelectMany(l => l.Assemblies)
                    .Select(Load);
            }
        }

GetCandidateLibraries only includes dependent assemblies (which for MVCSandbox only contains the MVC assemblies)

I believe the list of candidate assemblies should always contain the entry assembly plus optionally a set of referenced assemblies based on whether or not the DependencyContext is available.

@javiercn
Copy link
Member Author

/cc @pranavkm

@danroth27 danroth27 added this to the 1.0.0-rc2 milestone Mar 22, 2016
@danroth27 danroth27 added the bug label Mar 22, 2016
@pranavkm
Copy link
Contributor

GetCandidateLibraries only includes dependent assemblies

That's not true though. It should include the entry assembly if it references Mvc. What's the specific issue you were seeing?

@javiercn
Copy link
Member Author

Running MVCSandbox, the MVCSandbox assembly wouldn't be included. @pakrym is investigating and I believe he has more context

@pakrym
Copy link
Contributor

pakrym commented Mar 23, 2016

This is fixed in latest Cli+DependencyModel, lets keep it open to track the issue

@Eilon
Copy link
Member

Eilon commented Mar 23, 2016

If you have a bug/PR number that would be good.

@pakrym
Copy link
Contributor

pakrym commented Mar 23, 2016

Fixed == It's not broken there. Cli and dependency model being out of sync in mvc causes it.

@pranavkm
Copy link
Contributor

Yeah, I haven't noticed this using 1.0.0-beta-001718 CLI + the DependencyModel clone we have in Mvc.

@Eilon
Copy link
Member

Eilon commented Mar 23, 2016

Ah so we think it's fixed in newer builds?

@pakrym
Copy link
Contributor

pakrym commented Mar 23, 2016

Yes

@Eilon
Copy link
Member

Eilon commented Mar 23, 2016

Ok, we'll just hold onto this issue until we can verify. Thanks!

@NTaylorMullen
Copy link
Contributor

Using dotnetcli 001718 and finding that my applications runtime library does not have any listed assemblies for it when published. However, if I choose not to publish and do dotnet run all works fine.

image

@NTaylorMullen
Copy link
Contributor

Alright, turns out this happens if you don't do .UseContentRoot(Directory.GetCurrentDirectory()) in your Main. Yay 😵

Ignore me.

@pranavkm
Copy link
Contributor

Looks like this is fixed with the newest DependencyModel. @NTaylorMullen, the other issue is to make view discovery work and we could consider adding it to MvcSandbox to make our work flow bit easier.

@Eilon Eilon added 3 - Done and removed 1 - Ready labels Apr 1, 2016
@Eilon
Copy link
Member

Eilon commented Apr 1, 2016

This is now fixed.

@Eilon Eilon closed this as completed Apr 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants