|
I don't think you understand: it isn't supported. And if you're referring to the .NET base class library assemblies (mscorlib.dll, System.dll, etc.), then I'm guessing you also don't want the client to have the .NET Framework installed, huh? Guess what - that's not possible, either. The .NET Framework is more than just .NET assemblies - it's a complete runtime made up of system components and must be installed.
There is a project somewhere on the web that attempts to circumvent this, but all it really does is collect only the required components of .NET for a particular application and install them locally into a directory. It's still the .NET Framework, just a hack and not installed as system components, thus bloating the system.
Just like Java requires a JVM and VB6 and lower requires a VB VM (virtual machine), .NET requires the CLR.
Colin is right, though: if the dependent assemblies are ones you created, then don't create dependent assemblies and create all the code into one .EXE assembly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi friends
Thanx very much for giving me such a useful info and having a discussion with me.
I look forward for such a discussion in future
Thanx again
Naveen
|
|
|
|
|
IF set the visual style using Application.EnableVisualStyles(),so
the image in ListView can not be displayed. How to display the image
in ListView in XP visual Style?
Colin
|
|
|
|
|
Never seen that! You should call Application.EnableVisualStyles() only once, followed by Application.DoEvents() (this fixes a bug) as the very 1st 2 lines in Main().
top secret xacc-ide 0.0.1
|
|
|
|
|
You are right, Thank you !
|
|
|
|
|
leppie wrote:
You should call Application.EnableVisualStyles() only once, followed by Application.DoEvents() (this fixes a bug) as the very 1st 2 lines in Main().
Where were you when i needed to know that?
I pulled out lot of hair trying to find answer to that, guess that teaches me to try to find you guys as the first resort!
"Creating tomorrow's legacy systems today.....
.... One CRISIS at a time!" -- Unknown
"If you build it....
.....BUGS will come!" -JB
this.Dispose();
"A Bug is a piece of <sup> code </sup> that knows whatz its purpose"
|
|
|
|
|
In my win app,i embed a webbrowser control axWebBrowser1,after has loaded a page ,no matter what sentence below was executed:
((IHTMLDocument2)axWebBrowser1.Document).designMode="On";
or
((IHTMLDocument2)axWebBrowser1.Document).designMode="Off";
the browser's IHTMLElementCollection.Lenght will became to 0:
HTMLDocument doc=(HTMLDocument)axWebBrowser1.Document;
((IHTMLElementCollection)(((mshtml.HTMLDocumentClass)(doc)).all)).length<--=0
why?
|
|
|
|
|
I need to make a control, I think. All I need is a multi column list, with transparent background, which does not show a scroll bar, instead scrolling in response to function calls. If it could also associate a value with a row, and return that value instead/as well as the displayed data, I'd be in heaven. Know ye of such a beast ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Deriving from listbox, and using owner draw would be sufficient. Also enable the AllowTransparentBackground style with SetStyle().
top secret xacc-ide 0.0.1
|
|
|
|
|
Thanks - I actually ended up creating a control from scratch in the end Thanks for the SetStyle tip though, I definately needed to know that...
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hello,
I have developed a web service. The server (web service)serializes an object (a struct) via BinaryFormatter and then returns it to the client.
The client receives the serializated object and tries to deserialize it. This throws the following exception:
System.Runtime.Serialization.SerializationException:
Bynary stream does not contain a valid BinaryHeader, 0 possible causes, invalid stream or object version change between serialization and deserialization.
Here is the code:
serialization:
<br />
MemoryStream ms = new MemoryStream();<br />
BinaryFormatter bf = new BinaryFormatter();<br />
bf.Serialize(ms,myStruct);<br />
byte[] bArray = ms.GetBuffer();<br />
ms.Close();<br />
deserialization:
<br />
MemoryStream ms = new MemoryStream(bArray);<br />
BinaryFormatter bf =new BinaryFormatter();<br />
ms.Position = 0;<br />
myStruct struct =(myStruct)bf.Deserialize(ms);<br />
ms.Close();<br />
Do you know what is happening?
thank you.
|
|
|
|
|
It appears you have an assembly version mismatch.
Resolution:
Create a seperate assembly u can both reference from the service and the client (i tend to like give that a fixed version number, not the auto one).
Another problem u could have, that I have seen, is closing a MemoryStream after putting an image thru, causes problems, not sure if this a bug or not, as calling Dispose via an implicit interface call infact works.
top secret xacc-ide 0.0.1
|
|
|
|
|
hello,
"Create a seperate assembly u can both reference from the service and the client (i tend to like give that a fixed version number, not the auto one)."
Could you give me a reference (article, tutorial, book...) to learn how to do it?
Thank you.
|
|
|
|
|
This is basic. Create another assembly that defines the type. Both the client and server project depend on this assembly and use the type defined in that shared assembly.
As far as fixing the version number, go to your AssemblyInfo.cs file and change the AssemblyVersionAttibute value to something fixed (no asterisk - *). If you use an asterisk, the assembly version is automatically generated based on the documentation for the AssemblyVersionAttribute in the .NET Framework SDK. This is a terrible feature that wasn't meant to be in the .NET Framework originally, or so I hear.
.NET assemblies link against versions of other assemblies. Changing the version breaks this linkage, but there are ways to redirect assembly versions. Read Redirecting Assembly Versions[^] in the .NET Framework SDK for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hello,
I think I have found what is the problem... but I do not know the solution.
The problem is that I am using CAPICOM.SignedData. The process is as follows:
1.- Serialize the struct.
2.- Convert the byte array into a string via System.Text.Encoding.UTF8.GetString() method.
3.- sign the data (the string) with SignedData.sign() method and return the result (a string with a PKCS#7 structure) to the client.
4.- The client verifies the signed data and extracts the SignedData content (a string) which is the serialized struct.
5.- Finally, the client tries to deserialize the struct and it throws the exception.
I think the problem is the SignedData operations because without them I can serialize and deserialize the structs without any problem.
Any suggestions?
thank you.
|
|
|
|
|
hello,
i have solved partially my problem:
-- The problem with the signedData was the conversion from byte array to string: i was converting the byte array (the serialized object) into a UTF8 string instead an Unicode string. So, the solution was to use "System.Text.Encoding.Unicode.GetString()"
-- but now, I have another problem. When the client tries to deserialize the struct it gets the following message exception:
System.IO.FileNotFoundException: File or assembly name WEBSERVICE, or one of its dependencies, was not found.
I have develop a testing Console Application that serializes an object, signs it and verifies it with SignedData, and finally, deserializes it and it works well. So, I think it is a WebServices problem.
It sounds like client can not find the serialized object class or the namespace where it is contained but this is rare for me because the client can instanciate that class.
thank you one more time
|
|
|
|
|
Hi,
I am using C#, in my application main class contained object of another class but I need to call main class function in the contained class but I am unable to call main class(container class) function in contained class and I am unable to set reference of container class in contained class because it Viusal studio gives error "Circular Dependency".
Suggust me solution I can access container class function from contained class.
Thanks.
|
|
|
|
|
|
Hi,
If I put both in same assembly and I think they are in same assembly then how can I get assembly information runtime or how I can get function pointer or call function on runtime by using assembly information. Actually I tried but it creates new instance of contained class but I want a get the same instance and I am unable to find information. I will appreciate if you give me some examples.
Thanks,
-Samir.
|
|
|
|
|
You could also use an assembly that defines an interface (or abstract class, but this seems more appropriate for an interface) that the container class implements. This interface could also be defined in the current dependent assembly (since it already depends on it). This allows you to make late-binding calls. Just pass that interface as your parameter into your contained class (or a property value), which would actually be an instance of the implementation of the interface. This way you won't need to make a circular dependency and it makes your code a little more robust.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi
Is there any function that will allow me to copy the security attributes
of a file???
On the MSDN site under documentation of COPYFILEEX they say that "To copy
security attributes, use the SHFileOperation function";
I tried that but it still does'nt copy the security attributes.In Robocopy there is a option /SEC which copies NTFS permissions .....I Wonder how they
have done that.. Can anyone please help me in this.
|
|
|
|
|
You can always use xcopy.exe with the /O option.
The FOF_NOCOPYSECURITYATTRIBS (0x0800) - or rather the lack there of - should work, but will only work on NTFS. Be sure you've declared everything correctly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
The is no ".NET" function to do it ... yet. The .NET Framework versions 1.0 and 1.1 don't directly support NTFS permissions. That will change in the .NET Framework 2.0.
Are you talking about copying the File WITH the Security attributes or are you talking about Setting the security attributes (NTFS Permissions) of the File?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I tried to load via reflection System.Windows.Forms.Form but I got an exception SecurityException: StrongNameIndentityPermission .....
Could you help me ??
Thank you.
Wizard_01
|
|
|
|
|
It's called Code Access Security, and you should read about it to understand. Depending on what evidence is presented with your assembly, you may not be able to reflect anything. I recommend you read Understanding .NET Code Access Security[^] here on CodeProject and follow the links to the online .NET Framework SDK for additional information.
The specific permission being requested is for a strongly named assembly, which means you use sn.exe -k KeyFile.snk to generate key pair and enter the absolute or project-relative path in the [assembly: AssemblyKeyFileAttribute] typically found in AssemblyInfo.cs, or add it to a container with sn.exe -i KeyFile.snk MyKeyPair and put "MyKeyPair" (for example) in the [assembly: AssemblyKeyNameAttribute] , also found in the same file (makes it easier to use a single key pair for all your assemblies, which is the common way of signing assemblies for an organization or product).
Microsoft MVP, Visual C#
My Articles
|
|
|
|