Groups | Blog | Home
all groups > dotnet general > december 2006 >

dotnet general : Caspol -s off in .NET 2.0 error


Chester
12/21/2006 6:28:00 PM
Hi All,

We are doing development using remote login to distanced development
machines. As our profile is local, when we want to do build in the remote
machine, it takes long time. So in .NET 1.1 we used to switch off the CAS and
do the build. It used to be very much faster. Now, we've upgraded our systems
to .NET 2.0. When we try to build with CAS off, the build is breaking. I've
captured two errors,

Error1:

RegAsm : error RA0000 : Type library exporter encountered an error while
processing 'TradeActivity.IActivityResults.get_Test(#0), TradeActivity'.
Error: Type library exporter cannot load type 'Syste
m.Data.DataSet' (error: System.IO.FileLoadException: Unverifiable code
failed policy check. (Exception from HRESULT: 0x80131402)).

Error2:

Target UnmanagedRegistration:

C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(2720,9):
error MSB3212: The assembly "C:\Program Files\MDAFactory.dll" could not be
converted to a type library. Type library exporter encountered an error while
processing 'MDAFactory.StartBatchFetch2(#0), MDAFactory'. Error: Type library
exporter cannot load type 'System.Data.DataTable' (error:
System.IO.FileLoadException: Unverifiable code failed policy check.
(Exception from HRESULT: 0x80131402)).

Btw, we are using nant script to build. Any idea, how we can resolve this
issue?

Thanks in advance.

Regards,
stcheng NO[at]SPAM online.microsoft.com
12/25/2006 12:00:00 AM
Hello Chester,

From your description, you originally build your application with CAS
turning off to improve performance, however, when you tried this in
building a .NET 2.0 solution, you encountered some errors, correct?

From the error message, it seems the error occured when the build is
processing some COM interop objects (generate TLBexp output). Are you
exposing some managed classes to COM? I've just performed some research and
haven't found any exact matched cases in the internal database. For general
troubleshooting, I would suggest you try create a simple build script which
simply do the tlbexp or related task only to see whether the same problems
remains. If so, we can isolate the issue to a small scope for further
research.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
Chester
12/25/2006 8:51:01 PM
Hi Steven,

You are correct. It is failing when I do tlbexp. So I've created a simple
project with a class, which has a public method returns DataTable. When I try
to do a tlbexp while CAS off, it fails.

Code:

[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class TlbExport
{
public DataTable GetTable()
{
return new DataTable();
}
}

Error :

TlbExp : error TX0000 : Type library exporter encountered an error while
processing 'TlbExport.TlbExport.GetTable(#0), TlbExport'. Error: Type library
exporter cannot load type 'System.Data.DataTable' (error:
System.IO.FileLoadException: Unverifiable code failed policy check.
(Exception from HRESULT: 0x80131402)).

I'm thinking whether it has anything to do with our security.config
settings. But I couldn't figure out anything.

Regards,
Chester

[quoted text, click to view]
stcheng NO[at]SPAM online.microsoft.com
12/29/2006 9:15:11 AM
Thanks for your reply Chester,

I'll try performing some tests on my local side and will update you if I
get any new finding.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


stcheng NO[at]SPAM online.microsoft.com
1/4/2007 9:43:52 AM
Hello Chester,

I've performed some tests in my local environment and has reproduced the
exact behavior you met. currently I'll discuss with some other engineers to
see whether this is an existing issue or if there is any workaround. I'll
update you as soon as possible.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button