This is a migrated thread and some comments may be shown as answers.

Unable to build the application after adding telerik references

13 Answers 1788 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Avinash
Top achievements
Rank 1
Avinash asked on 04 Aug 2015, 12:47 PM

Hi,

I added references to telerik dlls in the code, with copy local set to true. But, when I am building the project I am receiving an error randomly. 

Error1Unknown build error, 'Cannot resolve dependency to assembly 'Telerik.OpenAccess, Version=2015.1.220.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342' 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.' C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets2689SMS

I am not using openaccess assembly at all. I have no idea why this keeps coming randomly. I am not even able to find the dll anywhere to add it to the project. 

Kindly help me fix this issue. 

13 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 05 Aug 2015, 04:17 PM
Hello Avinash,

We are not aware of this error and I am afraid that without your setup I won't be able to determine what is causing it. This is I would ask you to send me a sample project that references the mentioned assemblies and reproduces the issue. You can attach a .zip file in the support thread that concerns the same topic that you posted in our ticketing system. In the meantime you can double check the following:
  • Check if the all referenced Telerik assemblies are of the same version
  • Check if the assemblies built framework matches the target framework of the project. You can check the project's framework in its Properties.
  • Check if all dlls required from the used Telerik controls are added in the project's referenced assemblies.

Thank you for any help you can provide.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Avinash
Top achievements
Rank 1
answered on 06 Aug 2015, 04:44 AM

Hi,

I noticed that this problem occurs when telerik api is added with "Copy local" enabled, and if the solution is opened in a different machine than the one references were added from. I checked the version for all assemblies, and version is same for all of them, on both the machines. Project target framework is 4.5, and I am using telerik's Q2 version (I believe that is 4.5 as well). 

I have added all the telerik assemblies, although I am using only radexpander and gridview for now (I plan to use most of these at later stages). 

I noticed that the project is saving the full path of the bin folder instead of relative path. So, on other machine, build fails, and I have to manually add the references again. When I do that, I receive this error. 

 For your reference, I have updated the sample project to onedrive. You can download the same from http://1drv.ms/1UpwHSG

Kindly let me know if that helps.

0
Martin Ivanov
Telerik team
answered on 10 Aug 2015, 11:42 AM
Hello Avinash,

Thank you for the project. I tested it but the error doesn't appear on my side as you can see in the linked video. About the Copy Local attribute, note that it is set set to True by default and we are not aware of any issues with it. Can you please modify the project that you sent me to use only the dll's which causes the error and also include them in the project's local folder and send it back to me so I can try it with the assemblies you are using?

As for the dll's paths that are saved as absolute paths, you can change this behavior by using the HintPath attribute of the Reference tag in the project's file XML. Basically, the hint path gives visual studio a relative path where to search for the specific dll.

Thank you for any help you can provide.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Avinash
Top achievements
Rank 1
answered on 10 Aug 2015, 12:26 PM

Hi,

I am unsure, how it is working properly on your side. I have tried this on multiple devices, and I was receiving same error, because solution was unable to find the path.

Anyway, I tried copying the files to a solution folder, and then using hintpath to save the relative path. Thankfully, that works well. 

The error was happening because solution was unable to find the path to any of the telerik api. I tried adding only one reference, and same problem. I can send the full project with the dlls copied to solution folder, but that works properly now, so I don't think you will be able to recreate the problem. Kindly let me know if I should still send the project file again.

Thanks.

0
Martin Ivanov
Telerik team
answered on 10 Aug 2015, 03:39 PM
Hello Avinash,

I am glad to hear that you managed to resolve the error.

It seems that the dll's in your project were referenced from the local installation folder of the UI for WPF suite. Since I also have the installation on my side and I guess its location matches the location on the original machine where the project was create and its assemblies were referenced for the first time, visual studio managed to automatically find the required dlls. 

As for sending me a project, if the errors are not presented and you doesn't have anymore issues on your side, there is no need for sharing your implementation with me.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Avinash
Top achievements
Rank 1
answered on 11 Aug 2015, 04:15 AM

Hi,

Yes, even I gathered that much. Although, since I had "Copy Local" true, I would have thought it will update the reference path during build. Anyway, it works for now. I will let you know if the same issue happens again. Thanks for your help in this regard. 

0
Srikanth
Top achievements
Rank 1
answered on 19 Feb 2016, 06:48 PM

Hi,

I am experiencing the same issue with Telerik.Web.UI. I have simply added RadCombobox to the aspx page and after i checkin i get the error "licenses.licx (1): Unable to resolve type 'Telerik.Web.UI.RadComboBox, Telerik.Web.UI, Version=2016.1.113.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4' "

I tried changing the CopyLocal to False but do not see any change.We have a check-in build configured and if i remove the licenses.licx file then the solution give this error:Index.aspx.designer.cs (400): The type or namespace name 'RadComboBox' does not exist in the namespace 'Telerik.Web.UI' (are you missing an assembly reference?)

0
Marin Bratanov
Telerik team
answered on 22 Feb 2016, 02:25 PM
Hi,

Could you try simply deleting the contents of the license.licx file? This file is generated by the .NET framework and it is its components that maintain it (the lc.exe piece, to be more precise) and deleting the file should let you rebuild the solution so .NET can generate the file again.

If this does not happen, there may be something wrong with the .NET framework installation on your machine and I would suggest repairing its installation.

In the meantime, I can suggest you review the following article that explains common questions related to the licensing mechanism: http://docs.telerik.com/devtools/aspnet-ajax/licensing/license-file. It is highly likely that the source control integration is preventing .NET from properly updating the file (e.g., it may be read-only) so you may want to exclude it from the source control binding.


Regards,
Marin Bratanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Srikanth
Top achievements
Rank 1
answered on 22 Feb 2016, 02:55 PM

Here is what we did to fix this issue:

1. Deleted the Telerik.Web.UI dll from references.

2. Created "ThirdParty_Dlls" folder and moved the Telerik.Web.UI dll from Bin45 to this folder.

3. Cheked in that folder.

4. Added reference to the dll from ThirdParty_Dlls folder.

5. Checked in the Proj file.

6. CI build is able to get the dll reference and build is successful.

0
Magzhan
Top achievements
Rank 1
answered on 18 May 2016, 04:35 AM
how you solved the problem? details can be
0
Magzhan
Top achievements
Rank 1
answered on 18 May 2016, 05:03 AM
Unknown build error, 'Could not load file or assembly'Telerik.OpenAccess, Version=2015.1.220.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342' or one of their dependencies. Can not find the file specified.

0
Tom
Top achievements
Rank 1
answered on 23 Jan 2018, 06:52 PM

To all suffering from this error, this solution worked for me. Right-click the .dll file and click the 'Unblock' button on the General tab near the bottom. The button goes away after it is unblocked (in case you don't see it). Found the solution here: http://www.chilkatforum.com/questions/8260/could-not-load-assembly-operation-not-supported-exception-from-hresult-0x80131515

Hope it helps.

0
Tom
Top achievements
Rank 1
answered on 23 Jan 2018, 11:01 PM
Correction to instructions: Right-click the .dll file, select properties, and then click the 'Unblock' button on the General
tab near the bottom
Tags
General Discussions
Asked by
Avinash
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Avinash
Top achievements
Rank 1
Srikanth
Top achievements
Rank 1
Marin Bratanov
Telerik team
Magzhan
Top achievements
Rank 1
Tom
Top achievements
Rank 1
Share this question
or