could not load file or assembly sharepoint 2010 - visual-studio-2010

I am relatively new to sharepoint 2010 and I have the following error when I click on the a page/specific webparts
Could not load file or assembly 'AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies
I have checked that the dll is in my bin file with the correct version. Appreciate if anyone can help me with this. Thank you

Try to add your file to GAC (c:\windows\assembly).
If it still would not work, there might be SafeControl statement missing from web.config file.

Related

Can't load EntityFramework.dll 5.0.0.0 inside Visual Studio 2013 extension

I'm writing a Visual Studio extension which depends on EntityFramework 5.0.0.0. I included EntityFramework in my project. When I install my extension, my extension's DLL appears in VS extensions folder, and EntityFramework.dll appears with it as well.
However, when I run my Extension in Visual Studio 2013 (update 5), it can't load EntityFramework: System.IO.FileNotFoundException: Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Looking in Process Monitor, I saw that when I run my extension, VS2013 tries to load EntityFramework from a different path, which has it in a different version - 4.2. I'd expect VS2013 to continue to search for EntityFramework, and find it in my extension's folder, like it does for other dlls included in my extension, but it doesn't.
In VS2015, VS does manage to load EntityFramework 5.0.0.0, but it does so also from yet another different path.
Why doesn't VS2013 continue to search for EntityFramework in my extension's folder?
You need to specify a ProvideCodeBase attribute to specify that your extra assemblies should be loaded. "Sometimes" you get lucky and it finds something else, but that's never guaranteed to work. You can see a few examples of that being used here.

Reference dll cannot be updated in Visual studio

I have a website and need to update the dll such as Crystal Report in VS2015. However I added the update dll and rebuild it. There is an error
Could not load file or assembly 'CrystalDecisions.ReportSource, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
The new dll files are version 13. It looks like the website still references the old dll. I searched the solution and found someone has this kind of question How to update dll in asp.net. However I didn't have the view as it mention
(Double check your solution's reference to the assembly. Right-click > Properties > Specific Version should be set to False)
Would someone tell me how to solve the problem.
Remove and add again the reference to the proper dll

MVC3 referencing dlls installed in GAC

I have some legacy dlls installed as part of a asp.net MSI setup package. All dlls are installed into the GAC. On asp.net I was able to reference dlls in GAC by placing such entries into the web.config file
<add assembly="MY.DEPENDENCY.MODULE, Version=1.2.3, Culture=neutral, PublicKeyToken=qwertyuiop"/>
I did the same thing as above in MVC3 but my source complains it can't find the expected references. have anyone else know or done this before?
Thanks
Did you try adding a reference from inside VS? Right click on References>Add Reference
When you reference a dll via the Add Reference, you can have it push when you publish by clicking on the referenced dll and change the "Copy Local" option in properties to true. Then when you deploy use the publish function of the project.
This doesn't hard code a path when you publish, it just uses that path to do the compilation.
The published app will then look at the bin folder for that dll.

Deploy dll with resource files to sharepoint 2010 in visual studio 2010

I have problem to add a assembly to my sharepoint project. I have a assembly that contains resource files for different language. I have one file for English, Utility.resx och one for Swedish Utility.sv-SE.resx. When I build it, it will be one dll for the project and one for the swedish language. The problem is when I should deploy it to Sharepoint with Visual Studio. I have added the assembly for the project to my packagefile in my sharepoint project. But when I trying to deploy it but I got the message:
Error occurred in deployment step 'Add Solution': Error: Cannot add the specified assembly to the global assembly cache: Utility.resources.dll
I have tried to specified both sv-SE\Utility.resources.dll and Utility.resources.dll as Location when I added the assembly i package. Note that I want to add it as assembly from project output.
Anyone having an ideas how to solve this problem?
This should help - http://blogs.visigo.com/chriscoulson/deploying-localized-satellite-assemblies-with-sharepoint-2010/
You have to add the resource assemblies using "Add Existing Assembly" and hard code the path to the BIN\release\ folder and NOT "Add Assembly from Project Output" for some reason...
And no - you can't use bin\$(ConfigurationName) -- GAHH!
Why not deploying the resource files as resx?
They need to be added to the manifest.xml as "RootFiles":
<RootFile>
<RootFile Location="Resources\Utility.sv-SE.resx"></RootFile>
<RootFile Location="Resources\Utility.resx"></RootFile>
</RootFiles>
Hope that helps,
marco

visual studio project gives error after rebuilding

I am able to open a saved copy of my project in visual studio and it runs fine. After I rebuild the project it gives me the following error :
Could not load file or assembly 'System.Web.Ajax, Version=3.0.31106.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The system cannot find the file specified.
this is driving me crazy. please help
Use Fuslogvw.exe to troubleshoot this problem. It shows you where the CLR looked for the assembly.

Resources