Caspol -s off in .NET 2.0 error

G

Guest

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,
Chester
 
S

Steven Cheng[MSFT]

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.
 
G

Guest

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
 
S

Steven Cheng[MSFT]

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.
 
S

Steven Cheng[MSFT]

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.
 
S

Steven Cheng[MSFT]

Yes, this behavior is not easy to workaround. I'm still pinging the related
product team on this and will update you if I get any information.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


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

Steven Cheng[MSFT]

Hello Chester,

Just inform that we're still tracking the submited internal bug request and
the product team is finding proper resource to review on the issue. I'll
keep on informing you the latest update.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


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

Steven Cheng[MSFT]

Hello Chester,

As for this issue, the product team engineer has identified it and reported
a definite bug to windows sdk team also. Current we haven't got any
solution or workaround on this. However, if you want to further track this
issue, I would suggest you contact CSS since they'll have the more direct
and proper channel to communicate with product team.

Thank for your posting and understanding.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


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

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