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

How to load specific version assembly from GAC in ASP Net vNext #1688

Closed
gurunathancs1991 opened this issue Apr 22, 2015 · 6 comments
Closed
Assignees
Milestone

Comments

@gurunathancs1991
Copy link

I can load the assembly from GAC in ASP.Net 5 application. but i couldn't load the specific version. please have a look on my codes.

[project.json]

"frameworks": {
"aspnet50": { },
"aspnetcore50": { },
"net45": {
    "frameworkAssemblies": {
        "System.Web.Mvc": "5.0.0.0"
    }

}

}
In above code in project.json file, i have tried to load MVC 5.but it doesn't load in reference instead of that, it will show like with corrupted symbol. Even these assemblies are available in GAC. i have tried with some other assemblies. Am getting the same error only.

In case if i load without version details. it will automatically load the lowest version of MVC. i.e., MVC 3 is the lowest version in my machine. that was loaded in reference.

this is not with MVC assembly alone. we can reproduce it any assembly by following the below scenario.

Am having an assembly named as 'EssentialASP" which was available in GAC in two version like 1.0.0.0 , 2.0.0.0. If i refer without assembly version it will automatically load the lowest version. but if i try to refer some other version other than lower i.e., 2.0.0.0 then it couldn't load in the project (showing with corrupted symbol) in the reference section.

@muratg
Copy link
Contributor

muratg commented Apr 23, 2015

@gurunathancs1991 I believe frameworkAssemblies section is for specifying .NET Framework assemblies. Instead of using GAC, I recommend using dnu wrap to wrap the particular assembly you'd like with your project. This would give you the option to use CoreCLR in the future, and also potentially go cross platform.

That being said @davidfowl do we support version info for frameworkAssemblies? Should we just throw if there's anything specified there?

@guardrex
Copy link

@muratg

option to use CoreCLR in the future

Does this mean that dnu wrap could be used to roll System.Net.Mail into a dnxcore50 project?

@davidfowl
Copy link
Member

@guardrex nope

@troydai
Copy link
Contributor

troydai commented Apr 23, 2015

I can repo this issue. Investigating ...

@troydai
Copy link
Contributor

troydai commented Apr 23, 2015

It's a bug in GacDependencyResolver, it takes the first gac assembly which matches the reference name but doesn't compare the version.
https://github.com/aspnet/dnx/blob/dev/src/Microsoft.Framework.Runtime/DependencyManagement/GacDependencyResolver.cs#L61

I'm working on the fix.

@troydai
Copy link
Contributor

troydai commented May 7, 2015

Fixed in ce597a9

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

5 participants