Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataTable.GetChanges() Crashes...
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01189575
Message ID:
01192296
Views:
14
Hi Ben,

> I am trying to figure out if there is a way to ensure that this object cannot be instantiated without the needed parameters...but right now I don't see a way of doing that.

You could make the constructor internal and specify the assembly with the call to your constructor as a friend assembly:
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleTo("name, PublicKey=.....")]

class Whatever
{
  internal Whatever() {}
}
This gives the assembly "name" access to all public and internal types in the DLL. Please note that you have to specify the public key, not the abbreviated public key token. The constructor would still be visible to other classes in your assembly, though.
--
Christof
Previous
Reply
Map
View

Click here to load this message in the networking platform