|
Hello,
I m creating a C# .NET Project in which i m trying to load third party Assemblies which are installed in GAC.
But in some machines I m getting an error stating "Unable to Load assembly of specified version 7.0.351.0".
when i tried to do an assembly redirection it didn't work it still shows the same error.
Note:
7.0.351.0 - Is the version with which it is compiled.
12.0.0.0 - Assembly present in the Target machine
Properties of Reference
Specific Version -> False
Aliases -> global
Copy Local -> False
This is my sample application configuration file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" >
<dependentAssembly>
<assemblyIdentity
name="Act.Framework"
publicKeyToken="ebf6b2ff4d0a08aa" />
<bindingRedirect oldVersion="7.0.351.0"
newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
I have not placed the assemblies in application path, I just want it to redirect to the version present in the GAC(12.0.0.0).
How do I Proceed with this?
Thanks in Advance.
|
|
|
|
|
You will get this error if any dependent assemblies can't found also. Make sure everything is in place.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
a
modified 23-Nov-14 7:20am.
|
|
|
|
|
mdichild forms do not support transparency.
Normally the Paint event of a form does nothing (unless you have handled it), and so you see through to the results of the paintBackground event. In the case of a transparent form this paintBackground event handles painting the stuff underneath your form.
As soon as a form is made an mdiParent the paint event forces painting totally filled with the colour 'AppWorkspace'.
For mdiChildren it is a bit different. They now ignore the TransparencyKey, so the only thing you can do is set the backColor to Transparent, therefore making the MDIParent backColor display in the child. Note this is not transparency but just delegating the backColor to the mdiParent and so not that usefull. If you want to do this you will have to force your form to accept Transparent as a backColor which it does not normally do. To do this add the following two lines to the constructor of the mdiChild form.
this.SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = System.Drawing.Color.Transparent;
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Hiii all...........
I need helping for how can i use the winpcap & winDump libraries for capture and dump IP packets using C#.........
Thanks..
|
|
|
|
|
Hi
I would like to define a struct with array of int
I define the struct as below
The problem is that when I want to get the size of the struct, i'm getting it without the array size
such as
sNDIS_802_16E_ACTIVE m_NDIS_802_16E_ACTIVE;
m_NDIS_802_16E_ACTIVE = new sNDIS_802_16E_ACTIVE(20,20);
int size = Marshal.SizeOf(m_NDIS_802_16E_ACTIVE);
public struct sNDIS_802_16E_ACTIVE
{
public UInt32 NaplistLength;
public UInt32[] Nap;
public UInt32 NsplistLength;
public UInt32[] Nsp;
public byte [] aaa;
public sNDIS_802_16E_ACTIVE(UInt32 maxNSP_NAPSize, UInt32 maxNSP_NAPsize)
{
Nap = new UInt32[maxNSP_NAPSize];
Nsp = new UInt32[maxNSP_NAPSize];
NaplistLength = 0;
NsplistLength = 0;
}
} ;
please advice
ronen
|
|
|
|
|
the size of
public struct sNDIS_802_16E_ACTIVE {
public UInt32 NaplistLength;
public UInt32[] Nap;
public UInt32 NsplistLength;
public UInt32[] Nsp;
public byte [] aaa;
}
is 20B on Win32, i.e. 4B for each of the two ints, and 4B for each of the 3 arrays (an array is just a reference, not the data; the data sits elsewhere).
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hi
But I define the size of the array size in the constructor
Should the size of the member of the struct include array definitions?
Ronen
|
|
|
|
|
I don't understand your question.
In THAT struct, under Win32, each member takes 4 bytes, either for an int value, or for a reference. The size of the arrays themselves is irrelevant inside the struct, as they are separate objects.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
|
All -
I am looking for an easy solution to split a name field from another DB. I am converting data from on DB to another. In the source DB the name field is one field that is free form. Here are some examples of names:
John Smith
John E Smith
DR John E Smith
DR John Smith
In my db the name field is first and last name (separate fields).
Any suggestions?
As always thanks for your help!
sk
|
|
|
|
|
Its a tricky one because you have a number of possibilities, i.e. Title and middle names.
If this was a one of process I would use manual intervention, but would also have fields for title.
Do you want to retain the title anywhere? where should the middle name be included? I would put the middle name with the forename if I only had two fields (forename, surname)
Why don't you try something like...
void GetMeSomeNames(string fullname, out string forename, out string surname)
{
forename = surname = "";
string[] names = fullname.Split(' ', StringFormatOptions.RemoveEmptyEntries);
if(names.length == 0)
return;
if(names.length == 1)
{
forename = names[0];
return;
}
bool hasTitle = false;
switch(names[0].ToLowerInvarient())
{
case "dr":
hasTitle = true;
case "mr":
hasTitle = true;
}
for(int i = (hasTitle ? 1 : 0); i < names.length - 1; i++)
forename += names[i] + " ";
forename = forename.Trim();
surname = names[names.length-1];
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Essentially, it is a tough task. There may be names that just have a first and last or first, middle and last and it may contains salutations (Dr, Mr, Mrs, etc.) also. Writing a script to take care of all of these scenarios is really difficult. Just give it a try.
|
|
|
|
|
You need some sort of agreement on what is considered first name and what is considered last name.
You could also have the following eg:
John Smith Peeters
John Edward Smith
John Edward Smith Peeters
John Edward Smith-Peeters
John E. Smith-Peeters
...
You could filter Dr, DR, Mr, Ms, ... as a title and one letter words (with or without . like E or E.) can be considered firstnames, but I'm not sure if it's possible to have a 100% correct algorithm.
good luck.
|
|
|
|
|
I don't think it can be done without human intervention. At best you could put the last element in the last name field and everything else in the first name field. Then review any first names that contain a SPACE.
|
|
|
|
|
PIEBALDconsult wrote: At best you could put the last element in the last name field and everything else in the first name field.
That would yield a lot of problems where I live, as:
1) a lot of last names consist of two or three words, such as
"Miel De Schepper" and "Jan van der Spiegel" (first names are Miel/Jan); here you should at least check for "de", "van der" and "van de" (all possible capitalizations) and when they occur they are part of the last name.
2) first names could be composite ("Jean-Paulus") and last names could be composite ("Paulus-Beeldens"); now what when one of them is composite, the hyphen is missing, and the middle word of three could be a second half of the first name, or the first half of the last name (say "Jean Paulus Beeldens")?
I am 100% sure there isn't an algorithm that solves the problem, and IMO the best fit algorithm is very region dependent.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hi,
I am displaying Word Document using Web Browser, its working fine but i just want to show the text of that Word file. But currently its showing the Text as well the MenuBar on the top. Is there any way to hide the toolBar and so it only shows the Text ?
|
|
|
|
|
Hi
I have a form that has text boxes and combos bound to fields in an object. When the user is using the form they have the option to apply some default values to some of the fields. I was hoping that I would just have to either update the control with the value or just update the field in the object. When I update the field in the object, the form will not refresh with the new values until another field on the form is changed. If I update the control, the field in the object does not update.
My way around this was to update both like this
case "LOGCERT_LEVEL_":
logginCertCombo.SelectedValue = newValue;
staff.LogCert = newValue;
break;
To me that is a bit ugly
Is there a way to do this automatically? My controls are bound like this
logginCertCombo.DataBindings.Add("SelectedValue", staff, "LogCert");
I've tried google and today it is not being my friend.
Many Thanks
The FoZ
|
|
|
|
|
Sound like you want to look at the .BindingContext for your Form in order to get the BindingManagerBase (which will get you a Property Manager versus a CurrencyManager because it looks like you are binding to a single business object) so that you can use .PullData() and .PushData() to sync your controls and DataSource ...
|
|
|
|
|
Thanks for you reply Gerry, but I'm not sure how to get this working. I've looked up the Currency and Property Manager Classes and where the classes contain the Push and Pull methods they are not visible.
I created a private CurrencyManager myFormCurrencyManager for my form and added
myFormCurrencyManager = (CurrencyManager)this.BindingContext[staff] after I bound the controls. This caused an invalid cast exception so I changed it all to a PropertyManager still with no luck.
Am I missing something else? Do you know of any decent examples?
Cheers
The FoZ
|
|
|
|
|
Sorry about that; didn't realize those methods were protected.
Here is a solution that works: use the DataBindings ReadValue and WriteValue methods; eg.
<pre>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1 {
public partial class Form1 : Form {
private TextBox fistNameTextBox =
new TextBox() { Location = new Point( 0, 0 ) };
private TextBox lastNameTextBox =
new TextBox() { Location = new Point( 0, 30 ) };
private Button readButtom = new Button() {
Location = new Point( 0, 70 ),
AutoSize = true,
Text = "Read from Source"
};
private Person aPerson = new Person();
public Form1() {
readButtom.Click += new EventHandler( readButtom_Click );
fistNameTextBox.DataBindings.Add( new Binding( "Text", aPerson, "FirstName" ) );
lastNameTextBox.DataBindings.Add( new Binding( "Text", aPerson, "LastName" ) );
this.Controls.AddRange( new Control[] {
fistNameTextBox, lastNameTextBox, readButtom } );
}
void readButtom_Click( object sender, EventArgs e ) {
aPerson.FirstName = "John";
aPerson.LastName = "Smith";
foreach ( Control control in this.FindForm().Controls ) {
if ( control is TextBox && control.DataBindings.Count > 0 )
control.DataBindings[ 0 ].ReadValue();
}
}
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault( false );
Application.Run( new Form1() );
}
public class Person {
public string FirstName { get; set; }
public string LastName { get; set; }
}
}
}</pre>
|
|
|
|
|
Thanks Gerry.
The foreach loop was exactly the thing I was after
foreach ( Control control in this.FindForm().Controls )
{ if ( control is TextBox && control.DataBindings.Count > 0 )
control.DataBindings[ 0 ].ReadValue(); }
Cheers
The FoZ
|
|
|
|
|
Hi Everyone,
I have placed a sample code below in which i need to type cast from struct to list<object>. In this below example how i can add emp1 to operation list
public struct Operation
{
public bool success;
public string msg;
public List<Object> ListTest;
}
public struct Emp
{
public int EmpID;
public string EmpName;
}
public class Class1
{
public Class1()
{
//
// TODO: Add constructor logic here
//
}
public void Method1()
{
Emp emp1 = new Emp();
Operation op = new Operation();
emp1.EmpID = 1;
emp1.EmpName = "Manoj";
op.success = true;
op.msg = "pass";
op.ListTest.Add(emp1);
}
}
Regards,
Manowj
|
|
|
|
|
And your problem is?
Looking at it, you are getting a "object not set to an instance of an object" exception, I suspect. Try:
{
Emp emp1 = new Emp();
Operation op = new Operation();
op.ListText = new List<object>();
emp1.EmpID = 1;
emp1.EmpName = "Manoj";
op.success = true;
op.msg = "pass";
op.ListTest.Add(emp1);
}
Or, by preferance, convert it to a class and handle it's internals better yourself!
BTW: use <pre> and </pre> blocks to preserve your formatting in future. It isn't too bad with a tiny fragment like this, but later...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
Thanks for your response. how can this be converted to JSON using ExtJS, json serializer is not able to convert it.
Regards,
Manowj
modified on Thursday, November 5, 2009 7:14 AM
|
|
|
|