-
Notifications
You must be signed in to change notification settings - Fork 6
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
invalid reference in package for net45 version #11
Comments
Any suggestions how to fix this? Should the FSharp Core dependency be updated? I think there is 5.0.0 already available... Binding redirects may also help. |
Binding redirects help, but it should be used only for version upgrade (not downgrade).
Linq.Expression.Optimizer.1.0.14.zip Tested in my solution in net48/webforms/entityframework and netstandard/blazor/entityframeworkcore |
Thanks, this was very helpful. Probably you'd want to do <dependencies>
<group targetFramework="net35">
<dependency id="FSharp.Core" version="[4.1.18]" />
</group>
<group targetFramework="net45">
<dependency id="FSharp.Core" version="4.5.4" />
</group>
<group targetFramework="netstandard1.6">
<dependency id="FSharp.Core" version="4.1.18" />
</group>
</dependencies> ...so that the 3.5 version is exact match and others are "or-more", so the corresponding
|
Sorry, I didn't meant to close it just yet, but |
This dependencies configuration is little better 👍 |
Description
Repro steps
I have legacy solution with webforms, blazor and multitarget net48/netstandard21 projects. WebForms project version don't use optimizer yet, but have indirectly reference to it. When i add Swashbuckle to WebForms project it dosn't start at all.
Create multitarget net48/netstandard21 project.
Add Linq.Expression.Optimizer package to it.
Create WebForms project.
Add reference to first project.
Add reference to Swashbuckle package (it have reference to WebActivatorEx package).
You don't need actually use Linq.Expression.Optimizer or Swashbuckle
Expected behavior
Web site started succesfully,
Actual behavior
bin folder contains FSarp.Core version 4.4.1
Exception on start:
[FileLoadException: Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +197
System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +166
System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +156
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +612
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +149
WebActivatorEx.AssemblyExtensions.GetActivationAttributes(Assembly assembly) +164
WebActivatorEx.ActivationManager.RunActivationMethods(Boolean designerMode) +321
WebActivatorEx.ActivationManager.RunPreStartMethods(Boolean designerMode) +55
WebActivatorEx.ActivationManager.Run() +74
[InvalidOperationException: The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection
1 methods, Func
1 setHostingEnvironmentCultures) +890System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +167
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +133
System.Web.Compilation.BuildManager.ExecutePreAppStart() +178
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +746
[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4210.0
Known workarounds
Add FSharp.Core 4.5.4 package to WebFroms project
The text was updated successfully, but these errors were encountered: