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

Could not load file or assembly 'System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. #1602

Closed
last-Programmer opened this issue Aug 31, 2018 · 6 comments

Comments

@last-Programmer
Copy link

We have upgraded our oData Asp.Net appllication to .Net version 4.7.2 and we have reinstalled all the dependencies ie odata nuget packages and we have started getting the following error

Could not load file or assembly 'System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 52: SystemsModelBuilder(modelBuilder);
Line 53:
Line 54: EdmModel model = (EdmModel)modelBuilder.GetEdmModel();
Line 55:
Line 56: ParametersAddAlternateKeys(model);

Source File: C:\S\SGC\Sgc.Web\Web.OData\Utilities\ModelBuilder.cs Line: 54

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

[FileNotFoundException: Could not load file or assembly 'System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.]

[FileNotFoundException: Could not load file or assembly 'System.Linq, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.]
Microsoft.OData.Edm.EdmModel..ctor() +0

Any help would be appreciated to fix the issue

@last-Programmer
Copy link
Author

It seems to be that reinstalling odata nuget packages adds System.Linq, System.Linq.Expression, System.Reflection, System.Runtime.Extensions to references and also adds assembly redirection. Deleting the references and removing the assembly redirection solves the issue.

@xuzhg
Copy link
Member

xuzhg commented Sep 4, 2018

@rbmanian75 Since the issue was resolved, can I close it?

@last-Programmer
Copy link
Author

Hi,

To resolve the issue we need a manual interaction after installing the odata packages. It would be better when installing the packages these referenaces System.Linq, System.Linq.Expression, System.Reflection, System.Runtime.Extensions should not be added to the project like it is doing for .Net 4.6

@madansr7
Copy link
Contributor

madansr7 commented Sep 5, 2018

@rbmanian75 Sorry to hear the experience but it looks like a VS nuget package management related issue.

@txavier
Copy link

txavier commented Sep 19, 2018

I'm having the same problem. It's a good thing I found this thread or I would be totally stuck. Does the fault truly lie with nuget package management?

@Programer153
Copy link

I am getting the same error message when I have created a Blueprism object to execute a PowerShell command and capture the response. The process is running fine when I am trying to execute commands like Get-ADGroup, Get-Acl but it fail with the above error when I am executing the command as Get-QADGroup etc.
Code1

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

6 participants