I am developing a .net solution. Due to certain complications, I have been asked to add dlls to the solution and then reference the dlls from within the solution.
It works fine on the local box , and builds perfectly on TFS Build server,
but when I run it on the server after deploying , I get a run time exception saying :
Could not load file or assembly 'Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Would you know what I should be doing at this point ?
I can provide you more detailed info if needed.. please let me know.
It seems like you need to get Microsoft.TeamFoundation.Client.dll file,
then add it as a reference to your application
this is the dependencies you described:
Two possible resolutions
Set CopyLocal property to true so that when build is done local copy of dll is added.
Check reference folder has been checked in TFS or not. Sometimes it happens that reference folder is not added in TFS.
Related
I'm newbie to .net projects. Although I was able to code in c# & use it's frameworks, Some times I face exceptions which I really didn't get any proper resource/suggestion to modify or rectify them. Hope I would get clear this time.
The exception which I faced is as follows :
Could not load file or assembly 'Microsoft.AspNetCore.Cryptography.KeyDerivation, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.
I'm really confused with such type of exceptions. What's the reason for those & how we needs to cross check to clear those ?
Here is what I did install: "Microsoft.AspNetCore.Cryptography.KeyDerivation" from nuget console with version 2.2.0.
My installed packages list image :
The main reason for this type of error is a result of your output folder. Take a look at where your binary outputs were placed. Inside of that folder (usually your .exe or .dll output, not sure what kind of .NET project you're writing), you should also have all of your dependency dlls. In this case, the dll related to Microsoft.AspNetCore.Cryptography.KeyDerivation is missing. So when you go to run your executable, it complains "Could not load file or assembly KeyDerivation" because it couldn't find it.
To resolve this issue, double check your project's references and that there are no issues with the Microsoft.AspNetcore.Cryptography.KeyDerivation reference (what I mean is, make sure there are no yellow exclamations or other icons showing up next to this reference in your Solution Explorer). If you have any issues, remove the reference, then add the nuget package again.
After doing push from git server I got this error when I build and open my project:
Could not load file or assembly 'System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=******' or one of its dependencies. The system cannot find the file specified.
The project is working pretty well with the same code in a different computer.
Problem
The error is a file not found, like the one I helped out with the other day:
Could not load file or assembly .. The system cannot find the file specified.
Troubleshooting
Open ProcessMonitor and run it when VS won't let you build your solution and throws the error. Stop the trace when it fails and investigate ProcMon's (Filemon) log to see where the IDE is looking for the DLL it cant find.
Solution
Put the DLL where its expected to be found (this will hopefully sort out the VS library referencing failure).
Also try:
disable Resharper
restart VS
clean & rebuild
I found nuget or some other update can bump the System.Web.MVC version to 4.0.0 unintentionally. So just check the dll that you have in your bin folder (or wherever the reference points) is of the same version specified in your web.config.
I took over a project recently and it's using the NopCommerence package. When I load up the package in Visual Studio, it works fine, I have no troubles in VS, when I push live, everything is fine too, all works, but as soon as a few days sometimes even hours have passed, I get this error message:
Could not load file or assembly 'NPOI, Version=2.0.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
To solve this, I have to clean, rebuild and build the project and release a new set of files, my question is why does it randomly just fall over after so much time? I tried resetting the server, deleting temporary files but no luck.
Been doing this for weeks now and I can't find a solution.
This seems to be an issue where your .NET assembler is looking for an assembly of a specific version and instead of finding that, it is finding the assembly of that same thing, but of a different version.
It means that it wont work until both the files, i.e the actual file at the location and the reference in your configuration are same.
Check your config and then check on the actual file. If its of older or newer version, then replace it with the version that is actually required.
Here are a few links for your reference.
Assembly version mismatch
Resolving assembly conflicts
Hope this helps.
I'm not exactly a master of TeamCity (yet!) so please accept my apologies if this question is poorly formulated.
In my local IDE I can rebuild the solution. In TeamCity, I can do that too. Then, I add a new project, which has a reference to an external DLL (Oracle.DataAccess). While the local version builds without problems, I now get an error when running the build from TeamCity.
It claims that the problem is as follows.
error CS0012:
The type 'Oracle.DataAccess.Client.OracleDbType' is defined in an assembly that is not referenced.
You must add a reference to assembly 'Oracle.DataAccess,
Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342'.
Why does it complain about it when the local rebuild works?
What can be done about it?
I've checked that I'm targeting the correct repository to avoid this mistake. The only thing that changes is that I'm adding the project to the solution. I also noticed that removing the reference from the project fails the local build with the same message as the TC's. However, readding the reference to it (followed by a check-in) doesn't reciprocate the success of rebuild...
Suggestions?!
Make sure that reference to Oracle.DataAccess has attribute CopyLocal = true.
Also, take a look at the other properties as well. The path might be set to a locally available drive pointing to a file that isn't checked in to the VCS.
in Visual Studio I have a solution with several projects. In one project I added a reference to another project. All fine. I can see the namespaces/classes of the another project in autocomplete, etc.
When I try to do
OtherProjectNamespace.Class a = new OtherProjectNamespace.Class();
I'm getting this:
Could not load file or assembly '**OtherProjectNamespace**, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
There is no line, nothing, I tried try... catch around the new line and is not even catching the exception.
What could be the cause?
Thanks,
Carlos
Some possible directions:
Does the class you are trying to create have any dependency on a class in another assembly? If it does, try adding a reference to the third assembly.
Did the assembly get copied to the running directory of your application? Ensure that the Copy Local property of the reference is set to true.
If you still don't resolve the problem, use a tools such as Fusion Log View (comes with Visual Studio, run fuslogvw.exe from VS command line) to get the exact name of the file that was missing, and the locations from which the CLR tried to load it. Maybe this way you'll find another file that you need to copy.
Try this:
In the project references, change the "Specific Version" property to false. Right click on the project and select Clean. Then rebuild the project.