[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

MarshalDirectiveEx exception: "Excessively long string"

aimlab08

8/28/2008 5:41:00 PM

We have a window application, which is written in .net 2003 (C#). One
of our users installed our latest version yesterday. When he tried to
open the application, he get an unhandling exception:
System.Runtime.InteropService.MarshalDirectiveEx: Excessively long
string.

We moved back to install the previous version, again he got the same
error, but the previous version work for him before. Now the user can
not run our program from his machine at all.

The application is running fine for other users.

Any idea how to solve this issue?

Thanks in advance.

Linda
4 Answers

Peter Duniho

8/28/2008 6:22:00 PM

0

On Thu, 28 Aug 2008 10:41:04 -0700, <aimlab08@gmail.com> wrote:

> We have a window application, which is written in .net 2003 (C#). One
> of our users installed our latest version yesterday. When he tried to
> open the application, he get an unhandling exception:
> System.Runtime.InteropService.MarshalDirectiveEx: Excessively long
> string.
>
> We moved back to install the previous version, again he got the same
> error, but the previous version work for him before. Now the user can
> not run our program from his machine at all.
>
> The application is running fine for other users.
>
> Any idea how to solve this issue?

Find out why there's an "excessively long string" being passed around?

I know that sounds glib, but if you don't have any reason to expect
strings involved in your program to be excessively long, then the fact
that there is one suggests there's probably some corrupted data somewhere.

Ideally, you'd fix your program so that it provides a more informative
error, including being specific about what operation caused the error and
where the data came from. But at the very least, it's possible that a
complete uninstall and reinstall of the program and any data related to it
would cause the problem to go away.

Pete

aimlab08

8/28/2008 7:09:00 PM

0

Pete,

The previous version worked fine for the same machine until we
installed the new version. Now the previous version also stop working.
Also other users do not have this issue. I did a internet search, some
one posted the same question before. But I did not see any solution
for this.

Maybe some window patch we should install?

Linda
Peter Duniho wrote:
> On Thu, 28 Aug 2008 10:41:04 -0700, <aimlab08@gmail.com> wrote:
>
> > We have a window application, which is written in .net 2003 (C#). One
> > of our users installed our latest version yesterday. When he tried to
> > open the application, he get an unhandling exception:
> > System.Runtime.InteropService.MarshalDirectiveEx: Excessively long
> > string.
> >
> > We moved back to install the previous version, again he got the same
> > error, but the previous version work for him before. Now the user can
> > not run our program from his machine at all.
> >
> > The application is running fine for other users.
> >
> > Any idea how to solve this issue?
>
> Find out why there's an "excessively long string" being passed around?
>
> I know that sounds glib, but if you don't have any reason to expect
> strings involved in your program to be excessively long, then the fact
> that there is one suggests there's probably some corrupted data somewhere.
>
> Ideally, you'd fix your program so that it provides a more informative
> error, including being specific about what operation caused the error and
> where the data came from. But at the very least, it's possible that a
> complete uninstall and reinstall of the program and any data related to it
> would cause the problem to go away.
>
> Pete

Alex Clark

8/28/2008 8:06:00 PM

0

Is it possible that installing a new version of your app caused a
prerequisite to be installed (SP for .NET, or something similar?) which has
subtly altered the way the framework is handling long strings in interop
calls?

Judging by the error message, it looks like this might be the result of an
interop call, maybe a WinAPI call of some sort? If so, are you sure you
have all your API signatures correctly declared and that you're passing in
the right data types?



<aimlab08@gmail.com> wrote in message
news:d1354a71-ac0b-45b2-95e7-896a2ce8c7df@73g2000hsx.googlegroups.com...
> Pete,
>
> The previous version worked fine for the same machine until we
> installed the new version. Now the previous version also stop working.
> Also other users do not have this issue. I did a internet search, some
> one posted the same question before. But I did not see any solution
> for this.
>
> Maybe some window patch we should install?
>
> Linda
> Peter Duniho wrote:
>> On Thu, 28 Aug 2008 10:41:04 -0700, <aimlab08@gmail.com> wrote:
>>
>> > We have a window application, which is written in .net 2003 (C#). One
>> > of our users installed our latest version yesterday. When he tried to
>> > open the application, he get an unhandling exception:
>> > System.Runtime.InteropService.MarshalDirectiveEx: Excessively long
>> > string.
>> >
>> > We moved back to install the previous version, again he got the same
>> > error, but the previous version work for him before. Now the user can
>> > not run our program from his machine at all.
>> >
>> > The application is running fine for other users.
>> >
>> > Any idea how to solve this issue?
>>
>> Find out why there's an "excessively long string" being passed around?
>>
>> I know that sounds glib, but if you don't have any reason to expect
>> strings involved in your program to be excessively long, then the fact
>> that there is one suggests there's probably some corrupted data
>> somewhere.
>>
>> Ideally, you'd fix your program so that it provides a more informative
>> error, including being specific about what operation caused the error and
>> where the data came from. But at the very least, it's possible that a
>> complete uninstall and reinstall of the program and any data related to
>> it
>> would cause the problem to go away.
>>
>> Pete


Peter Duniho

8/28/2008 8:22:00 PM

0

On Thu, 28 Aug 2008 12:08:45 -0700, <aimlab08@gmail.com> wrote:

> Pete,
>
> The previous version worked fine for the same machine until we
> installed the new version. Now the previous version also stop working.
> Also other users do not have this issue.

All of those things are consistent with the possibility that something
about that user's installation has become corrupted.

> I did a internet search, some
> one posted the same question before. But I did not see any solution
> for this.

The most likely explanation for that is that this isn't the kind of
question that can be answered simply by knowing the error message.

> Maybe some window patch we should install?

You could try. But, it's a shot in the dark. You'd be better off
actually trying to debug the issue so that you know how and why the error
is actually being caused.

Pete