Copying over VS2008 project with ADO.NET Data Entity Model

G

gregarican

My old laptop died and I copied over a VS2008 C# project to my new
one. This project entails using LINQ to query a ADO.NET Data Entity
Model and push the results into an XML file. Pretty straightforward.

When I build the project it's all good. But when I try to run the
project it fails when the program is trying to iterate through the
LINQ result set. The inner exception is listed as "Loading this
assembly would produce a different grant set from other instances."

I googled around and saw that perhaps some permissions issues are the
culprit. So I went in and verified the connection string was okay. It
is, as I built an identical ADO.NET Data Entity Model to the same DB
using the same connection settings and it tested out fine. I also went
into the app.config and set the trust as full. Still no dice getting
the program to run.

Any suggestions? When I debug my program right before the point of the
exception I see the model is totally empty of records. But I know I
can connect to it and I know my connection settings are okay. Is there
something else copying over the project that I need to change?
 
R

RayLopez99

My old laptop died and I copied over a VS2008 C# project to my new
one. This project entails using LINQ to query a ADO.NET Data Entity
Model and push the results into an XML file. Pretty straightforward.

Well you are screwed. One thing about ADO.NET in general is that it
does not migrate well. Permissions problem likely, not to mention
sometimes a hard coded string will point to a now non-existent
directory. One time I remember the program would work fine under XP
when I was the "Administrator", but not when I was the "Power User",
despite doing everything in my power to propagate the permissions.

Very frustrating. If possible I would just rebuild the app from
scratch, if it's not too much bother.

RL
 
A

Arne Vajhøj

Well you are screwed. One thing about ADO.NET in general is that it
does not migrate well. Permissions problem likely, not to mention
sometimes a hard coded string will point to a now non-existent
directory.

Both file references and permissions are fixable problems.

I would even consider them easily fixable problems.

Arne
 
M

Mr. Arnold

gregarican said:
My old laptop died and I copied over a VS2008 C# project to my new
one. This project entails using LINQ to query a ADO.NET Data Entity
Model and push the results into an XML file. Pretty straightforward.

When I build the project it's all good. But when I try to run the
project it fails when the program is trying to iterate through the
LINQ result set. The inner exception is listed as "Loading this
assembly would produce a different grant set from other instances."

I googled around and saw that perhaps some permissions issues are the
culprit. So I went in and verified the connection string was okay. It
is, as I built an identical ADO.NET Data Entity Model to the same DB
using the same connection settings and it tested out fine. I also went
into the app.config and set the trust as full. Still no dice getting
the program to run.

Any suggestions? When I debug my program right before the point of the
exception I see the model is totally empty of records. But I know I
can connect to it and I know my connection settings are okay. Is there
something else copying over the project that I need to change?

Do you have SQL Server 2005 on the machine without SP2 for SQL Server 2005?

That will cause execution problems with EF with iterating over the
result set, since EF is not accessing SQL Server until it starts
iterating over the results.
 
G

gregarican

Do you have SQL Server 2005 on the machine without SP2 for SQL Server 2005?

That will cause execution problems with EF with iterating over the
result set, since EF is not accessing SQL Server until it starts
iterating over the results.- Hide quoted text -

- Show quoted text -

Actually I have SQL Server 2005 locally installed, but it's patched at
the most recent revision level. This particular ADO.NET query was
hitting a remote SQL Server 2000 SP4 database. I eventually pared
through everything and found the misaligned references. Moving the
project indeed wound up pointing some things in the wrong direction.
Part of my project would publish the query results as an RSS feed.
Running it on my laptop resulted in it launching a local ASP.NET
development website. That's where things broke down. In production I'm
looking to host the RSS feed on a remote website.

Long story short is that I broken my project down into two separate
components --- 1) the SQL query and 2) the RSS feed being published.
It's all good now!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top