I am getting a bizarre error that has crippled an application with tens of compile errors that were not there before this issue occurred. Most of the compile error's are not recognizing objects in the XAML code that were fine before this error.
The error,
Unknown build error, 'Cannot resolve dependency to assembly
'Microsoft.SharePoint.Client.Runtime, Version=15.0.0.0,
Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxx' because it has not
been preloaded. When using the ReflectionOnly APIs, dependent
assemblies must be pre-loaded or loaded on demand through the
ReflectionOnlyAssemblyResolve event.
The events leading up to this are,
2 of us collaborating on GitHub
The other collaborator downloaded Windows Office reference for Excel
Office.Interop.Excel reference seems to all be there on my end
When updating to last commit, runs fine on my machine until I re-build solution
Runs fine on collaborator's machine.
I have never used SharePoint on my machine.
I have never come across something like this. From what I can see the required references are there. I am lost as to what I need to do to get this to work again.
The answer to this was that the other collaborator had installed Office Developer Tools and after I downloaded them as well, all the compile errors were fixed. It seems that not all the references were there.
I hope this helps someone in the future.
Related
I've researched a lot on stackoverflow and no one really explained what to do in my case.
I have application that is using a TFS Api, and it is using a Nuget packages that contains dll like Microsoft.TeamFoundation.*.dll.
Here comes the tricky part - When I run application from debug everything is working fine since CLR is loading dlls from my , BUT when I deploy application and start using it, it loads dlls from the GAC if any of those dlls exists in GAC.
This causes numerous errors since it loads different versions e.g. Microsoft.TeamFoundation.1stdll.dll with version 11.2.2302 then Microsoft.TeamFoundation.2nddll.dll with version 11.0.2123 and there are cases when it starts with 10, and then asking for a reference 10 dll to resolve issue and I end up with exception.
What I did?
I've tried to point to probing path with without success. As soon as it finds for example version 11.0.2.1 in GAC and 11.3.1.2 in probing it resolves dll with GAC one.
I've tried as someone explained to create a new appdomain and to share dlls between domains but I've hit the dead end, no matter what I've tried it loaded it from the GAC. I've also tried to load dlls at entry point of my app, and than to redirect it to my path and resolved it. Again no success. I've tried to trick application and at resolving point return null for publicKeyToken in order to tell it that I am using a non-signed dll, in which case it wouldn't look at the GAC, but had no luck. I've tried to remove signing with Nirsoft snremove.exe and guess what? No success either.
I am looking for a code that will no matter what force my application to use my dlls instead of one in GAC. I want to avoid that during runtime it does not randomly pick up a 11.00.xxxx version but instead use my specific 11.92.21212.2 even when it has bigger or in some cases lower versions.
The only thing that I cant accept as a possible solution is to manually configure CLR interfaces for resolving and loading assemblies in C++ as someone mentioned on stackoverflow before.
One thing I can think of is you can try is to limit the permissions of the new Application domain you load to not have access to the file system, drive, or to the GAC path more precisely, for example on the first call into a method in the new domain or a constructor set the permissions like it's done here.
Then you can embed the needed assemblies in the Resources of the application and use the AssemblyResolve event to load them like this.
I am running a project that had been running without issue for some time but recently started throwing an error stating,
"Could not load file or assembly 'Microsoft.Practices.Unity,
Version=2.1.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
or one of its dependencies. The system cannot find the file
specified."
I see that this assembly is for IoC/Dependency Injection support however I never explicitly added it to the solution; although I do see that it is in fact there.
When I check the version of the assembly it is showing the same version that is being referenced in the above error; so I cannot figure out why the file cannot be found by the project.
In effort of resolving the issue I've cleaned the solution, deleted my obj folder, rebuilt, removed and even reinstalled the assembly via nuget but the issue persists.
I've found somewhat similar issues reported here on SO but the proposed resolutions were either not applicable because it was not the same assembly reference as the one I'm having issue with OR it involved configuration of a XAML based application. This is ASP.NET.
The only other clue that I could find as to why I'm having the problem is that the targeted runtime framework of the assembly is v2.0.50727 and this application is .NET 4.5
Which would seem a reasonable explanation for the problem from my limited perspective except that the app was previously running without the problem.
I'd also mention that the assembly isn't explicitly being called from the block of code throwing the error; which is simply creating a web service client and calling a method.
long memberId = 1326728123;
ServiceClient sc = new ServiceClient("ServiceClientEndPoint");
var leadPackage = smc.GetLeadPackages(memberId);
So there could be other variables of this equation that may be attributing to the problem (e.g. Network blocking and etc)
I just wanted to make certain that I may not be missing something by running it past SO before wasting time going in the wrong direction for an answer.
Note that this could mean a number of things, including that one of the dependent assemblies of Microsoft.Practices.Unity could be loaded.
The first place searched is the GAC, if you are building and running on the same machine, this probably won't cause a problem because the runtime will also find the same library but if you are deploying, the project will sometimes bind to the GAC library whereas the production server might not have it installed and it will fail to run. CopyLocal=true should fix that but if you are deploying, you should check that the library is copied into the bin directory.
Secondly, you should open Microsoft.Practices.Unity.dll using reflector or ilspy.exe and see what other dependencies it has (other than the System.* libraries) since any other ones will need the same treatment as Microsoft.Practices.Unity i.e. adding to the project and copy local set to true.
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.
I have an MVC website hosted in Azure Websites, that when run locally, works great.
However, when I publish to Azure Websites, I get the error message:
Could not load file or assembly 'Microsoft.VisualStudio.DebuggerVisualizers, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Doing some research on this type of error, I see that it could possibly be related to either (a) referencing an incorrect version locally than one that is installed on Azure, or (b) a DLL is referencing Microsoft.VisualStudio.DebuggerVisualizers as a dependency.
My issue is that I have no idea how to debug this. If the issue is caused by (a), how can I tell? If the issue is caused by (b) how ca Microsoft.VisualStudio.DebuggerVisualizers?
I've been struggling with this for too many hours now, and googling doesn't seem to lend much help.
Has anyone encountered this error before?
UPDATE
Screenshot of my References folder. Nothing out of the ordinary in my opinion, but clearly something is going on.
This was a weird one, and I'm still not sure of the actually reason.
I ended out completely deleting the website from Azure, and republishing, and it works fine.
This was an ok solution for my case because my website was in its infancy.
I'm trying to get set up with ImageMagick.NET with Visual Studio 2012. I've done much research into what seems to be a common issue whereby Visual Studio is not recognizing the dependencies of ImageMagick.NET (it recognizes the .NET DLL just fine judging by the auto complete). I took steps suggested in threads such as this:
http://imagemagick.codeplex.com/discussions/66874
whereby the .NET DLL is referenced within the project, making sure I take note I chose the 16-numbered build, then downloading the 6.5.3-10 versioned dependencies from the following link:
http://image_magick.veidrodis.com/image_magick/binaries/
which installs the DLLs and places them automatically on the system path so I shouldn't theoretically have to copy the DLL's from the install directory into my project.... but this I also have done, in several different locations, including the project root, bin, the Debug and x86 directories, etc. I also made sure I was building for x86 machines, as that seems to be the only architecture supported by the DLL. Yet despite my measures, no dice! I would greatly appreciate if someone has any further insight into why this might be happening the way it is. I'm building a C# project and trying to just initialize the project within a Windows 8 grid app template.
Thanks in advance!
EDIT: I apologize in not being explicit about the error message I am receiving:
Exception: Thrown: "Could not load file or assembly 'ImageMagickNET.DLL' or one of its dependencies. The specified module could not be found."