|
I am currently developing a remoting object for my wbsite (www.play47.net) and am experiencing the following problem. If you have any ideas, they would be greatly appreciated...
The remoting object has the following method:
public void MailQueueItemsSet(MailQueueItem job)
This returns a custom object which I have defined back to the DB (ie deletes / updates and needed).
This object (MailQueueItem) has the following definition:
[Serializable()]
public class MailQueueItem : DataItem, ISerializable
Now, from my client application I call the following method:
coordination.MailQueueItemsSet(job);
And receive this exception:
System.Runtime.Serialization.SerializationException: Because of security restrictions, the type play47.mail.RemotingInterfaces.MailQueueItem cannot be accessed. ---> System.Security.SecurityException: Request failed.
at System.Security.SecurityRuntime.FrameDescSetHelper(FrameSecurityDescriptor secDesc, PermissionSet demandSet, PermissionSet& alteredDemandSet)
at System.Runtime.Serialization.FormatterServices.nativeGetSafeUninitializedObject(RuntimeType type)
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)
--- End of inner exception stack trace ---
Server stack trace:
at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.UnsafeDeserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at play47.mail.RemotingInterfaces.CoordinationServer.MailQueueItemsSet(MailQueueItem job)
at play47.mail.SMTPClient.SMTPClient.DoJob(MailQueueItem job) in C:\Inetpub\wwwroot\play47\SMTPClient\SMTPClient.cs:line 257
at play47.mail.SMTPClient.SMTPClient.DoWork() in C:\Inetpub\wwwroot\play47\SMTPClient\SMTPClient.cs:line 132
If you have any ideas regarding this problem they would be greatly appreciated...
Tatham Oddie (VB.NET/C#/ASP.NET/VB6/ASP/JavaScript)
tatham@e-oddie.com
+61 414 275 989
|
|
|
|
|
Have you added the remoting object to your web config under the well known objects? If not then the .Net security will not let you use the object. I think there are a few examples of how to set up Remoting on CP. Just search for Remoting and you will find some good articles on how to set up and use remoting.
See:
http://www.codeproject.com/useritems/iishostedremoting.asp?target=remoting
|
|
|
|
|
Ok, I thought you only had to include it in the config to get an instance, then from there on it just got whatever objects it needed.
Thanks for your help... Most appreciated - it works now!
Tatham Oddie (VB.NET/C#/ASP.NET/VB6/ASP/JavaScript)
tatham@e-oddie.com
+61 414 275 989
|
|
|
|
|
I want to learn about snmp soure code with c#,where can find it?
|
|
|
|
|
Can someone convince me to crossover from visual c++ 6 to c#. What's so good in it anywhy, does it have a future of some sort, or is it like basic and qbasic other than the difference in name...
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
nobody can convince you...
If you are interested in C# go and read a few articles or a book...
Then think for yourself and tell us what you think about it...
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
One is new, simple, and has a promising future. The other is old, complex, and has a questionable future.
Regards,
Alvaro
Hey! It compiles! Ship it.
|
|
|
|
|
I have two apps on the same machine, one has to check and see if the other's Remoting server is running, beofore it tries to connect. If it's not running, then the (client) app should launch the other app, and wait for it to finish loading, and then try again to connect.
Two questions:
1. How do I check to see if it's running or not? I can just try and catch an exception but I'm wondering if there's a better way.
2. How do you recommend I wait until it starts (with a timeout so I don't wait forever)?
thank you
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
If it's hosted as a service use a service controller component...
However, what you are trying to do implies that the server is always on the client - why use remoting?
"Enterprise Solution Patterns using Microsoft .NET" says that remoting calls can be at least 1000 times slower than a local call in the CLR.
Tatham Oddie (VB.NET/C#/ASP.NET/VB6/ASP/JavaScript)
tatham@e-oddie.com
+61 414 275 989
|
|
|
|
|
Tathan thanks for your response,
I am using remoting to communicate between my BHO and a C# application. The BHO's are loaded by each instance of Internet Explorer, each seperate from one another, and relay information to the application. The nature of a BHO is that it runs in the same process as the IE instance, and therefore isn't in the same CLR as the application (each BHO is in it's own CLR instance).
I looked at the ServiceController class, but it seems to be for the purposes of starting and stoppig a windows service. I don't have any services- it's all apps (well and BHO's). (Also btw, a service could be running but have it's remoting server turned off...) Am I missing something?
thanks
bog
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
I'm developing my first useful C# application, and I've come to quite a few points where I'm thinking "There has to be a better way to do this than what I'm doing", and this is one of those cases.
Often times when I load a dialog, I'll need information/objects from the main form in the new loaded dialog. Right now when I load a custom dialog from the main form, I do something like this:
CustomDialog dlgName = new CustomDialog();
dlgName.Loader = this;
dlgName.ShowDialog();
...
And then to access the main form's data in the CustomDialog example:
Loader.DataINeed;
Is there a special variable or other way I can access the main dialog's public objects from a new dialog without passing a reference to that main dialog's object?
|
|
|
|
|
Delegates/Events will do the trick, there are many articles here on CP discussing this. You should also look into creating your own EventArgs class which can be tied to your delegate . HTH
-Nick Parker
|
|
|
|
|
Hi,
I'm using a BindableListview for which I found the code on the web:
http://www.interact-sw.co.uk/utilities/bindablelistview/source
and I'm also using the ListViewSortManager found on Code Project:
http://www.codeproject.com/cs/miscctrl/lvsortmanager.asp
I have found a funny interaction between the two. After binding the ListView to the DataSource, when the ListView is re-sorted the data gets out of sync.
For testing purposes, I added a few simple controls which also bind to the same DataTable, for instance a TextBox and a CheckBox (one of the column is Boolean).
After setting the ListView and the Controls' DataSource to the same DataTable, the data is synced such that if I select an entry in the ListView, the TextBox and CheckBox show the proper values.
Now, after sorting the data using different columns, the data in the textBox and CheckBox doesn't show the same value as the selected item in the ListView.
I'm assuming this is because the DataBindings are using an index, and that re-sorting the ListView differently doesn't necessarly affect that index.
How would I proceed to "re-index" the data such that clicking an item in the ListView brings up the proper data in the textBox and CheckBox ?
Thanks.
Luc Morin
|
|
|
|
|
in the code behind page for my web application i enter newline characters (\n) but the label that i want to display the text ignores the newlines and prints as one long line
thanks all
gil s
|
|
|
|
|
As much as I can rememeber I set the width of Label to 0 then it was resize according to the text I gave ti it automaticly,Setting width of Label is kind of hard,it very depend on where do you pet the label like is it in a table cell and how do you set the properties of Table,Row or its cell.
Mazy
No sig. available now.
|
|
|
|
|
Any suggestions on how best to retrieve a web page via an HTTP connection and then save/display the results as an image. I can get the web page as HTML okay within a stream but am not sure what to do with it next.
Any suggestions would much appreciated.
Cheers
Andy
|
|
|
|
|
I'm new to this but I choosed the way of 'Capture the screen'. The basics you can read here: http://www.c-sharpcorner.com/Graphics/ScreenCaptFormMG.asp
BUT there's a BIG problem with this: the browser screen/windows can NOT be overlapped !!! If some windows is on browser windows so both of them will be on screenshot image! Nothing we can do about this. I choosed to make the browser window 'Top most' in properties but... this is not the way.. and the browser windows can NOT be hidden !! No screenshot in this case (just empty space)
Another way is to go down and handle all HTTP POST/GET request by yourself but it's seems like a hard way You can check 'mshtml' class for this.
P.S. How did you get a HTML page on stream ? How did you open a stream to HTML page ? Can you send me a code ?
"I have not failed.
I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
|
|
|
|
|
To get the user from directory service the below code works perfectly fine.
But i want to access files in the user name ou=myname. I have place a text file name note.txt in myname writeing this addres in explorer
ftp://.admin.myname.user.novell@nldap.com/USER/myname/
all i want to know how to access the files. How can i get the files which i have uploaded on myname..... so i can modify n delete them also.
i have got the help to add user modify user n delte user but not abot the files of users ...
string path = "LDAP://www.nldap.com";
System.DirectoryServices.DirectoryEntry entry = new .DirectoryServices.DirectoryEntry(path);
System.DirectoryServices.DirectorySearcher mySearcher = new
System.DirectoryServices.DirectorySearcher(entry);
mySearcher.Filter = ("(ou=myname )");
SearchResult result = mySearcher.FindOne() ;
if( result != null )
{
Console.WriteLine("User found");
foreach( string key in result.Properties.PropertyNames )
{
// Each property contains a collection of its own
// that may contain multiple values
foreach( Object propValue in result.Properties[key] )
{
Console.WriteLine(key + " = " + propValue);
}
}
}
else
{
Console.WriteLine("User not found");
}
|
|
|
|
|
i have search form which is modal , i want to return some values back to main form n search it there , can any one help me , i hope so
anyways thx n tc
Work Hard and Test your Luck
|
|
|
|
|
Put the values into public properties and retrieve them after closing the dialog:
YourSearchDialog dlg = new YourSearchDialog();
if( dlg.ShowDialog() == DialogResult.Ok ){
yourResult = dlg.ResultProperty;
}
|
|
|
|
|
Hi All,
I have a solution where I have some of my classes written using MC++ and I'm trying to use those classes in my C# project, but I can't for the life of me figure out how. I'm not sure I have make the C# project aware of the classes. I think I'm going to need to use a "using" statement, but I don't know what it should be. The MC++ stuff is in an exe and not a dll so I don't think I can add a reference to it. Any help would be appreciated.
Thanks
- monrobot13
|
|
|
|
|
|
If you're going to share code between apps/libraries, it probably should be in a DLL, not an EXE. That will probably solve your problem.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
|
But my answer was more readable.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|