Skip to content
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

Reference assemblies are incorrectly being marked as references #1739

Closed
pranavkm opened this issue Nov 15, 2017 · 8 comments
Closed

Reference assemblies are incorrectly being marked as references #1739

pranavkm opened this issue Nov 15, 2017 · 8 comments
Milestone

Comments

@pranavkm
Copy link
Contributor

Seems like the opposite of #1738

I'm working on updating AspNetCore's repositories to use the 2.2 SDK. With the 2.0.0 SDK, when attempting to publish a Mvc application (https://github.com/aspnet/MvcPrecompilation/blob/dev/testapps/RazorPagesApp/RazorPagesApp.csproj for reference) for net461, Microsoft.Win32.Primitives (among others) is recorded as a referenceassembly in the deps file:

"Microsoft.Win32.Primitives/4.0.3.0": {
  "type": "referenceassembly",
  "serviceable": false,
  "sha512": ""
},

With 2.2.0-preview1-007522 SDK, it ends up in the deps file as a reference:

"Microsoft.Win32.Primitives/4.0.3.0": {
  "type": "reference",
  "serviceable": false,
  "sha512": ""
},

This in turn causes view compilation to fail, with

Cannot find compilation library location for package 'Microsoft.Win32.Primitives'
     at Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths(ICompilationAssemblyResolver resolver, List`1 assemblies)
     at Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths()
     at Microsoft.AspNetCore.Mvc.ApplicationParts.AssemblyPart.<>c.<GetReferencePaths>b__8_0(CompilationLibrary library)
@pranavkm
Copy link
Contributor Author

cc @eerhardt \ @dsplaisted could you recommend any workarounds for this?

@weshaggard
Copy link
Member

@joperezr could you please have a look?

@joperezr
Copy link
Member

Sure I can take a look. @pranavkm do you have a fork of the repo with your changes so I can try take a look at a repro?

@pranavkm
Copy link
Contributor Author

@joperezr here's a simpler repro - https://github.com/pranavkm/repro1739/tree/master/app. Running dotnet run and navigating to the site root (http://locallhost:5000) should print the exception from DependencyContext.

@joperezr
Copy link
Member

ok, great I'm taking a look

@joperezr
Copy link
Member

I am able to repro the problem, but I'm not too familiar with the task that generates the deps file. Task seems to be GenerateDepsFile which lives on the sdk task library. @dsplaisted do you know what might be going on with it? Was there a recent change that maked the referenceassemblies be flagged as type reference now?

@livarcocc
Copy link
Contributor

@pranavkm is this still reproing for you? I just tried this using the latest CLI from master and dotnet run and open the page worked as expected using your repro repo above.

@livarcocc livarcocc added this to the Discussion milestone Feb 12, 2018
@pranavkm
Copy link
Contributor Author

We've been using 2.1.0-preview1\preview2 sdks for a while now and I haven't seen this issue reproduce.

GangWang01 pushed a commit to GangWang01/sdk that referenced this issue Jun 7, 2022
GangWang01 pushed a commit to GangWang01/sdk that referenced this issue Jul 11, 2022
JL03-Yue pushed a commit that referenced this issue Mar 19, 2024
* Enable CodeQL for official builds

* Set Codeql.Enabled to true for the build job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants