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

Telerik ORM 2010.1 gives error Cannot find resource NorthwindModel.rlinq embedded in assembly ConsoleApplication1

23 Answers 732 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andre
Top achievements
Rank 1
Andre asked on 09 Jul 2010, 09:01 AM
Hi,

I've just created my first project with the new Visual Entity Designer. I Followed the steps explained in Stephen Fortes Blog:
http://www.stephenforte.net/PermaLink,guid,734374ef-65ac-442c-a8f1-571ca9084729.aspx

When I now try to run the application, I get a TypeInitializer Exception on that line:

 

 

 

NorthwindEntityDiagrams d = new NorthwindEntityDiagrams();

The Inner Exception is an ArgumentException and says:
Cannot find resource NorthwindModel.rlinq embedded in assembly ConsoleApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

The BuildAction of NorthwindModel.rlinq is OpenAccessDeploy.
My solution has only one project: "ConsoleApplication1".

I'm using VS 2008 and Telerik ORM 2010.1.623.5

The 2010.1 Version had been installed over an existing 2009.1 Version.

my full code looks like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
  
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            NorthwindEntityDiagrams d = new NorthwindEntityDiagrams();
  
            var result = from c in d.Customers where c.Country == "Germany" select c;
  
            foreach (var customer in result)
            {
                Console.WriteLine(customer.CustomerID);
            }
            Console.ReadLine();
        }
    }
}

The App Config looks like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="NorthwindEntityDiagrams" connectionString="data source=.\sqlexpress;initial catalog=Northwind;integrated security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>

Attached are Screenshots of the Telerik Designer and the solution explorer showing the properties of the rlinq file

Any help would be really appreaciated.

Thanks in Advance

Andre

 

 

23 Answers, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 14 Jul 2010, 05:43 PM
Hello Andre,

We tested the problem against the following versions of the product:
- Telerik OpenAccess ORM 2010.1.414.3;
- Telerik OpenAccess ORM 2010.1.623.5;
but  we were unable to reproduce the failing behavior with the settings provided from you. It seems the error is thrown only when the Build Action is set to None.
I hope you will find the attached example useful.

Regards,
Damyan Bogoev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Andre
Top achievements
Rank 1
answered on 14 Jul 2010, 07:50 PM
Hello Damyan,

thank you very much for your answer. In addition to this forum post, I had opened a support request. An answer to this support request has solved my problem.

The problem was caused by a wrong entry in the openaccess.targets msbuild file (which I didn't touch). In this file, there's variable "OpenAccessPath" defined. In my installation it ended with a backslash. Because of this, the enhancer never fired during my bulid process because the EnhancerPath in the Build file starts with a backslash, too. So the generated path looked like this:
c:program files\telerik\open access\\sdk\enhancer.exe.

When I removed the backslash at the end of the open access path variable, everything started to work. My guess is that this file hasn't been replaced during my upgrade installation from 2009.1 to 2010.1 .. but that's just a wild guess.
0
Damyan Bogoev
Telerik team
answered on 15 Jul 2010, 05:04 PM
Hello Andre,

We are glad to see that you managed to cope with the problem. It seems the OpenAccess.targets file was not updated during the update of the product and the new enhancer cannot work correctly with this path.

Sincerely yours,
Damyan Bogoev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Cristian Apavaloaiei
Top achievements
Rank 2
answered on 15 Oct 2010, 02:37 PM
I'm having the same problem, i have a clean install of OpenAccess 2010.2... The weird thing is that it was working until this morning, and i have no idea what could have caused the custom tool not run anymore. I tried setting the build action to Embedded Resource, it embeds the resource in this case but i get other runtime errors (i'm guessing this is why i have to use OpenAccessDeploy).

The only thing that i can think of that i modified since this morning was installing two visual studio fixes, this one and this one.

I also checked the OpenAccess.targets file in C:\Program Files\Telerik\OpenAccess ORM\sdk and i had 
<PropertyGroup>
    <UseOpenAccessTargets Condition="'$(UseOpenAccessTargets)'==''">true</UseOpenAccessTargets>
    <OpenAccessPath Condition="'$(OpenAccessPath)'==''">C:\Program Files\Telerik\OpenAccess ORM\</OpenAccessPath>
    <EnhancerAssembly>$(OpenAccessPath)\sdk\enhancer.exe</EnhancerAssembly>
</PropertyGroup>
I tried removing the last backslash from the openaccesspath and it still doesn't work.
0
Cristian Apavaloaiei
Top achievements
Rank 2
answered on 18 Oct 2010, 01:25 PM
I still haven't found a cause for this problem, but i recreated the project and everything works just fine now. I hope this problem doesn't appear again, the custom build action used to work in the old project too until a couple of days ago.
0
Damyan Bogoev
Telerik team
answered on 19 Oct 2010, 07:04 PM
Hi Cristian Apavaloaiei,

I am glad to see that you managed to handle this problem. One possible cause for the error behavior is damaged project file in some way after installing these features. Could you verify that the project file is not modified after the install?

Best wishes,
Damyan Bogoev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Cristian Apavaloaiei
Top achievements
Rank 2
answered on 20 Oct 2010, 08:34 AM
I'm sorry but i deleted that project file when removing the old project, if this problem appears again i will analyze the project file in more depth.
0
Damyan Bogoev
Telerik team
answered on 22 Oct 2010, 06:23 PM
Hello Cristian Apavaloaiei,

If the error persists please let us know. It would be helpful if you can provide us with the project file or a sample application in order to investigate this behavior on our side.

Greetings,
Damyan Bogoev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Bill
Top achievements
Rank 1
answered on 02 Nov 2010, 10:20 PM
I am using version 2010.2.714.1 and just created a new WinForms application in VS2010.

I created my model off of an existing database, it generated the rlinq file and the associated CS file. (I told it to put everything in a single file).

When I run the app and call :  MyDBContext db = new MyDBContext():

I get the same error message that started this thread.  The inner message is telling me that it can't find the rlinq file in the assembly and if I trace into it, it's this call that's blowing up:

private static MetadataSource metadataSource = XmlMetadataSource.FromAssemblyResource("MyDBRQ.rlinq");

That is the proper name of my RLINQ file, so not sure why it's having trouble.

I haven't had any issues with MVC apps using OA, just my WinForms app now.

On a side note, are the samples and such that are included with OpenAccess going to be updated?  I tried to build the WinForms sample (using VS2008) and couldn't get it to build.

Also - all of your tutorials are out of date (which you probably already know <G>) - many of the examples, including your PDF that gives a "STEP BY STEP tutorial" which has a date of March 2010 in it seems to be out of date (http://www.telerik.com/support/documentation-and-tutorials/step-by-step-tutorial-for-openaccess.aspx) - the screen shots don't match what I see when I use the product.
0
Damyan Bogoev
Telerik team
answered on 08 Nov 2010, 10:43 AM
Hello Bill,

1. I was unable to reproduce the false behavior on my side. I tested the scenario against the following version of the product: 2010.1.714. I have to ask you for a sample application which demonstrates the error in order to investigate the issue further.
2. Yes, the tutorial uses previous version of the product. You could use our online help documentation which is up-to-date.

Kind regards,
Damyan Bogoev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Herr
Top achievements
Rank 2
answered on 09 Nov 2010, 09:25 AM
Hi Bill,

maybe you need to use AttributesMetadataSource instead...?
0
Damyan Bogoev
Telerik team
answered on 11 Nov 2010, 04:03 PM
Hello Michael,

Yes, we tested the scenario using AttributesMetadataSource as well. Could you please verify that Build Action for the rlinq file is set to OpenAccessDeploy?
1. Select the rlinq file from the Solution Explorer;
2. Press F4 and find the 'Build Action' setting under the Properties Window grid;
We are looking forward to your reply.

All the best,
Damyan Bogoev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Richard Slade
Top achievements
Rank 2
answered on 02 Feb 2011, 10:08 PM
Hi Guys,

I'm new to Open Access and I'm having the same issue. I have followed the documentation that was installed with OA to the letter 3 times. the only difference being I am running this as a WinForms app.

I am trying to re-create the Model First demo with Students and Region. All teh tables are created correctly, though the documenation is slightly out in that it doesn't inform you that you need to set the precision on the column, and also the entities that it creates all have the column types set to Object rather than the correct value type.

I have verified that the Build Action of the rlinq file is set to OpenAccessDeploy.

For information, I am running the latest version of both the WinForms controls and Open Access and am running SQL Server Express 2008 with Windows Authentication, .NET 4, Windows 7 64 bit.

The error is:  Message=Cannot find resource MyDatabase.rlinq embedded in assembly Telerik.OpenAccessTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
       Source=Telerik.OpenAccess

Any advice would be appreciated.
Thanks
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 03 Feb 2011, 12:28 AM
Hello,

Small update on this. If I open the Model Settings and change over the Mapping type from XML to Attributes, then I now get the following error on the Regions
"No metadata has been registered for class"

It also seems that none of the classes have been marked as persistant.
Thanks in advance
Richard
0
Zoran
Telerik team
answered on 07 Feb 2011, 06:32 PM
Hi Richard Slade,

 It seems that the enhancer has not run, and your classes are not enhanced. Could you verify if the following line of XML is part of you project file (Open your .csproj or .vbproj file with an XML editor). 

<Import Condition="Exists('$(MSBuildExtensionsPath)\OpenAccess.targets')" Project="$(MSBuildExtensionsPath)\OpenAccess.targets" />

Greetings,
Zoran
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Richard Slade
Top achievements
Rank 2
answered on 07 Feb 2011, 06:40 PM
Thanks for the reply. This line did not appeat in my vb.proj file. I added it but it has currnetly made no difference.
thanks
Richard
0
Zoran
Telerik team
answered on 10 Feb 2011, 09:05 AM
Hello Richard Slade,

 This means that the OpenAccess.targets file is not placed in your MSBuild directory. That file should be  installed together with the OpenAccess product in your MSBuild directory: C:\Program Files (x86)\MSBuild or C:\Program Files\MSBuild. Could you check if you have this file available in one of those directories? The fact that it could not be there indicates that OpenAccess might not be correctly installed or maybe not installed at all on the machine that you are using at the moment.

Greetings,
Zoran
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Richard Slade
Top achievements
Rank 2
answered on 10 Feb 2011, 11:11 AM
Hi Zoran,

I'm very pleased to say that a re-install of Open Access has solved the issue.
I may be mistaken, but I seemed to notice though that after the upgrade the first time I tried it, it still didn't work. The reason for it not running this time seemed to be that when I started a new project (VS 2010), the project is created in the appdata directory, as it should be until I decide to save the solution to the usual MyProjects directory. Open Access seemed to be unable to decorate the vbproj file with the ImportCondition until I had saved the solution to it's permenant save path. The second time I tried it, I saved the solution first to the MyProjects directory and the project file was amended and re-loaded as it should be. Is this normal?

Anyway, I'm very pleased it's working now. Thanks for your guidance.
Regards,
Richard
0
Zoran
Telerik team
answered on 11 Feb 2011, 02:13 PM
Hi Richard Slade,

 Firstly, I am very glad that this issue is finally resolved on your side and you are able to continue your development with OpenAccess. I can not confirm that what you mentioned is the reason for the bad  experience as we have not observed such behavior yet. It is not normal that the project editing by our designer is dependent on the location where the customers solution is saved.

Anyway, good that it is finally solved. Maybe you could try with a new project which is not previously saved to your projects folder, but in the temporary one instead. Than you can observe if those errors re-appear. That way we could be sure if this was the actual cause or not and if it is we will schedule it for further investigation and fixing.  

Best wishes,
Zoran
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Richard Slade
Top achievements
Rank 2
answered on 11 Feb 2011, 02:34 PM
Hi Zoran,

Yes, all working fine now and I love using Open Access. I have tried again with a new project and I can consistantly replicate the issue though.
  1. Start a new VS2010 Winforms project (vb.net in this case)
  2. Add an empty domain model, giving db connection details. Leave other defaults as per the demo
  3. I am then prompted that it needs to be enhanced. I click OK
  4. I am prompted to save the solution to it's permanant location. I save
  5. I add a couple of tables and map to persistant type

The first clue that something is wrong is that the created entities do not have the correct types. I specified Id(int) Name(varchar) for exmaple for region, and they are both specified in the entity as Object. See screenshot.

I'm happy to open a support ticket and help out in any way that is required, so please just let me know.
regards,
Richard

0
Zoran
Telerik team
answered on 16 Feb 2011, 11:05 AM
Hi Richard Slade,

 We verified the issue and yes you are right, it is better when you have your solution saved to you 'real' directory. Also regarding the wrong mapping, it is a bug on our side with a very easy workaround again and that is closing and re-opening the .rlinq file. We internally handle the TypeResolver when the diagram is being opened, but as you have observed there can be problems on the very first load of the designer when it is not yet saved.

Thanks a lot for the feedback, we appreciate it very much and we will do our best to improve this user experience for our next release. Your Telerik points have been updated.

Regards,
Zoran
the Telerik team
0
Dewey
Top achievements
Rank 2
answered on 12 Oct 2011, 11:39 AM
I have been having this same issue with 2011.2.908.1. I checked my .proj and the correct entry is there. My build action is set to OpenAccessDeploy. I checked my OpenAccess.targets file and it had the extra \ in there so I removed it. The issue still occurs when it hits this line in my EntityDiagrams1.cs file.
private static MetadataSource metadataSource = XmlMetadataSource.FromAssemblyResource("EntityDiagrams.rlinq");

I also have an issue where the generated .cs is EntityDiagrams1. Originally it was EntityDiagrams and then it created a second file. I've deleted all of the generated files, cleaned the solution and when I rebuild it still creates EntityDiagrams1.cs... kind of annoying.
0
Serge
Telerik team
answered on 17 Oct 2011, 09:07 AM
Hi Dewey,

 If you get a problem in this line, this means that the rlinq file has not been embedded in the assembly (it is usually embedded by the OpenAccessDeploy task). Please locate the import statement in the project file and remove its condition attribute, this way when you try to reload the project you will see whether the file is correctly located. 

It would be best if you could send us the project you are experiencing this error with, so that we can more easily locate the culprit. (You will have to open a support ticket in order to be able to attach the project though)

As to the problem with the name of the generated file, this is a Visual Studio bug that you can easily work around. Just (again) open the project file definition and locate the LastGenOutput tag, of the rlinq file and edit its name to the one you want.

I hope this is helpful.

Best wishes,
Serge
the Telerik team

Check out the latest stable build of Telerik OpenAccess ORM. Download it and benefit from our new Project Templates.

Tags
General Discussions
Asked by
Andre
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Andre
Top achievements
Rank 1
Cristian Apavaloaiei
Top achievements
Rank 2
Bill
Top achievements
Rank 1
Herr
Top achievements
Rank 2
Richard Slade
Top achievements
Rank 2
Zoran
Telerik team
Dewey
Top achievements
Rank 2
Serge
Telerik team
Share this question
or