|
Try the ARP command which displays the physical address. You can use the System.Diagnostics.Process class to run the ARP command from .NET.
|
|
|
|
|
Hi,
My NET debuggers do not work. I get an error:
"Error while trying to run project:Unable to start debugging.
No such interface supported."
Note that this is not the commonly mentioned web debugger problem.
I have tried completely uninstalling VS NET and re-installing. Did not fix.
Any suggestions?
Thanks,
Robert
|
|
|
|
|
I finally tried uninstalling IE6 and re-installing IE6. Now my debuggers work, but the startup page throws script errors.
Arrgggghh!!
Robert
|
|
|
|
|
OK, I'm ready to be ridiculed.
I've run into an issue when attempting to use strong names. I've followed darwen's example and have it working in a console app, but it fails in a windows app with
An unhandled exception of type 'System.Security.SecurityException' occurred in StrongNameTestForm.exe
Additional information: Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
(additional details at the bottom of this message) or (if not run in the ide)
The application attempted to perform an operation not allowed by the security policy. The operation required the SecurityException. To grant this application the required permission please contact your system administrator, or use the Microsoft .NET security policy administration tool.
If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will be shut down immediately.
Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlig, Version-1.0.50000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
If I change the application from a windows app to a console app the call works in main() [before Application.Run(new Form1());], but not in the button click event from the form.
I've run the .NET Configuration tool (mscorcfg.msc) and tried adding an application and adding a code group (enterprise, machine, and user; new code group with a condition of Strong Name with the public key [the dll, the console app, and the windows app all show the same public key] without specifying the name or version and with the permission set of full trust) all to no avail. I have also tried this on multiple machines.
I do have a small (59k) zip file of my solution and projects, if anyone is interested.
Additional details:
************** Exception Text **************
System.Security.SecurityException: Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckTokenBasedSetHelper(Boolean ignoreGrants, TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet denied, PermissionSet demands)
at StrongNameAssembly.StrongNameTestAssembly.StaticEcho(String text) in C:\dl\dotNET\code samples\Securing\StrongNameTest\StrongNameAssembly\StrongNameTestAssembly.cs:line 31
at StrongNameTestForm.Form1.btnStaticTest_Click(Object sender, EventArgs e) in c:\dl\dotnet\code samples\securing\strongnametest\strongnametestform\form1.cs:line 108
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The state of the failed permission was:
<ipermission class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
="" version="1" publickeyblob="002400000480000094000000060200000024000052534131000400000100 01009515D3907C35834756D430D20B8C4672668C3CAC0EFF041317166F8CC53FDA01CE72D7C 728A942762957F6A7A2264656EBCE5C04078AAFD3E6F7FFFB6ADC799AB011CED46D9B6129F1 1E6517144138B57C85865CBC56E4F2BFFF6651F3FF702F0E039F16CEE9F31B976B51A582977 478B3DD0A52CAC873814646F01FABC8E2BE">
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
StrongNameTestForm
Assembly Version: 1.0.1865.20729
Win32 Version: 1.0.1865.20729
CodeBase: file:///C:/dl/dotNET/code%20samples/Securing/StrongNameTest/StrongNameTestForm/bin/Debug/StrongNameTestForm.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
StrongNameAssembly
Assembly Version: 1.0.1865.19430
Win32 Version: 1.0.1865.19430
CodeBase: file:///C:/dl/dotNET/code%20samples/Securing/StrongNameTest/StrongNameTestForm/bin/Debug/StrongNameAssembly.DLL
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
|
|
|
|
|
I've found the problem (thanks to others).
I was using SecurityAction.Demand rather than SecurityAction.LinkDemand.
Demand checks all assemblies in the stack for permission. Obviously there was some issue with permissions on one of the .NET assemblies, but I'm not going to worry about it.
|
|
|
|
|
Hi!
Is there a way I can tell when a class library is loaded.
I want a static item in in a class library when it's loaded and then if it's unloaded I want to remove this item.
Is this possible?
|
|
|
|
|
Why don't you simply put it in a type constructor (or declare it as static)? That way, it will run before any field in that type is accessed. What's the point in removing the item if the assembly itself is going to be unloaded?
Regards
Senthil
|
|
|
|
|
Hi,
I need some with the Socket programming in C#. I’m a old Borland C++ Builder and converted to .NET some years ago. But I still miss a lot of nice features :-> Can anybody here help me with getting a “event”, interrupt or callback when one end of a socket connection disconnects. I’m not thinking about when a user or application disconnects deliberately but more like when someone pulls the cable or switches off the pc.
Can some one help me?
/ Magnus
|
|
|
|
|
well, I'm trying to write a .NET 2.0 application (since I need serial-ports and I hate using non-.NET-components) but I have a problem...
every time I run my programm (serial-ports don't do anything yet so that shouldn't be the problem) I get a NullReferenceException...
when I try to run it with the debugger, first it's about 500times slower and second the exception isn't thrown at all but the debugger locks up somewhat later...
I'm using threads so maybe that could be the cause but the main problem I got is:
when the exception is thrown (without debugger) it gives me the option to launch the jit-debugger... but when I click to launch it it launches visual studio 2003; and that just can't debug .NET 2.0
so:
how do I get the jit-debugger to use vs2005?
any idea?
thanks, so long.
|
|
|
|
|
Hi...
I can't seem to get the column name stored in a string.
It keeps giving me this error:
Embedded statement cannot be a declaration or labeled statement
This is what I am trying to do..
for(int col=0; col
|
|
|
|
|
Your for loop isnt complete:
for (int col = 0; col < personTbl.Columns.Count; i++) {
string colName = personTbl.Columns[col].ColumnName;
}
|
|
|
|
|
sorry....
cut and paste error...I have it just like yours
|
|
|
|
|
I'm writing an essay on .NET framework, but I can't find any information on how Microsoft started the .NET development, the timescale and so on.
There seems to be a lot of information out there how Java was made but nothing about .NET. Hasn't Microsoft released that information to the press ?
Regards, Desmond
|
|
|
|
|
|
Thanks, that was usefull, anything else ?
|
|
|
|
|
Hi..
I am new to datagrid and windows forms. Here's is what I am trying to do. I have a datagrid which is bound to a datasource. In my datagrid I have a custom combobox column. Depending upon users selection in the combobox column certain columns in the datagrid becomes uneditable.
I have no idea how to capture user input from the combobox column and inactivate the dependable columns.
I have no idea where to start...
Any help will be greatly appreciated
Thanks in advance
-RP
|
|
|
|
|
i am not sure my giving this solution that, is it true or no ? but please try to solve your prblem.
firt, capture the value from the combo box and than check its with other columns which you want to made uneditable by apply the contion that if the particulare item is selected from the combobox than set the editable property of that columns.
|
|
|
|
|
Dear,
You can try in this way. You can use the method FindControl of the datagrid item to find the control in your datagrid
<br />
Dim x as new control<br />
for each x in datagrid.controls<br />
...<br />
next<br />
You use this code to show all the control in the datagrid, then you can try deeper into the datagrid item to find your combobox... then you can use the method findcontrol in the datagrid item to get value and set value for your control.
PS: I'm not sure if the code is correctly right or not. But that's the idea. I did well in ASP .NET
Ich liebe .NET
|
|
|
|
|
Does Microsoft specify a way to determine whether the .net framework is installed?
I'd like to use that in a NSIS-Skript.
thomas
|
|
|
|
|
From http://blogs.msdn.com/junfeng/archive/2004/02/05/67815.aspx[^]
For v1.0:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0]. If REG_SZ value 3705 exists, then .Net framework v1 is installed.
For v1.1:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.1] ...test the existence of REG_SZ value 4322.
Charlie
if(!curlies){ return; }
|
|
|
|
|
Also if you search the user contributed stuff on the NSIS website they HAD a function for determining if .NET was installed and would download it from the MS website and install it for you.
Steve Maier, MCSD MCAD
|
|
|
|
|
OK, i now finally have one that satisfies me. It can be found under http://nsis.sourceforge.net/archive/nsisweb.php?page=537&instances=0,110 and checks whether a minimum version of .net is installed.
the one you mentioned downloading .net is a bit too quick and dirty; it just checks
IfFileExists "$WINDIR\Microsoft.NET\Framework\v1.1.4322\installUtil.exe"
thanks
thomas
|
|
|
|
|
Hello,
I have a problem when building my project. Everything build fine, but I just have to build way too much. I'm sure that there is an 'easy' solution, but I don't know where to look.
I have a project that consist out of maybe 50 seperate dll's (probably around 40 are self developed and the others are bought from other vendors). The dll's are all strong named and offcourse there are dependencies between them.
Suppose I have following structure
Model.dll (-> classes used in every program I use (like customer, adress, ...)
Data.dll (depends on Model.dll -> classes to connect to mssql, access)
Diary.dll (depends on Model.dll and Data.dll -> program that represents a diary)
Statistics.dll (depends on Model.dll and Data.dll -> program that represents a statistical program)
Suppose that in the data.dll I have a method like the following (It's just an example)
public int GetSomeData (int _Test)
{
if (Test == 0)
return 1;
return -1;
}
Now I want to make the function like this
public int GetSomeData (int _Test)
{
if (Test == 0)
return 1;
else if (Test == 1)
return 0;
return -1;
}
I need to rebuild the data.dll offcourse. But because of the strongnaming I also have to recompile the Diary.dll and the Statistics.dll
This is somehow cumbersome and nothing changed in the code for these dll's.
My question now is: How can I rebuild the data.dll and not recompile it's depending dll's without breaking the dependency and knowing that all dll's are strong named? Or where should I be looking to solve this problem?
Thanks in advance,
Best regards,
Ike Casteleyn
icasteleyn@hotmail.com
|
|
|
|
|
Probably an easy answer to this one, but I can't see it.
I have a simple shared Assembly (Strong Named) packaged into a .msi for deployment on client machines.
I create the package using Microsofts Knowlwdgebase Q324168
"HOW TO: Deploy an Assembly to the Target Computer Global Assembly Cache"
It says
1. To the Solution that contains the project, add a new Setup Project that references to the assembly.
2. Right-click File System on Target Machine, click Add Special Folder, and then click Global Assembly Cache Folder.
3. By default, the assembly is inserted in the Application Folder (by default, it is a side-by-side installation). Drag the assembly to the Global Assembly Cache Folder.
4. Build the Setup Project.
I run the Setup on the target machine and all works fine.
The thing is I can't find the installed dll file anywhere on the client.
I have two applications sharing this dll and no clue of where it sits on the hard drive.
Does installing to the GAC cause an assembly to be treated differently?
Any ideas, would really appreciate any insight into this.
John
|
|
|
|
|
JohnARyan wrote:
Does installing to the GAC cause an assembly to be treated differently?
Yes.
The actual assemblies in the GAC are stored in %WINDOWS%\assembly, but the search feature in Windows Explorer won't be able to find them there. To view the contents, you can either use the shell extension provided (the folder will be viewed using the extension if you browse there with Windows Explorer) or the command-line tool Gacutil.exe.
gacutil.exe /l will list all the assemblies in the GAC while gacutil /l myassemblyname will give you the information for any matches it finds. (Note that you provide the assembly name, not the DLL name, so do not give the .dll extension)
I've found that an assembly won't be put into the application folder if it is placed in the GAC folder *and* it is excluded in the Detected Dependencies folder in the setup project. (Its icon will be shown in black and white and there will be a little circle with a cross through it.)
Charlie
if(!curlies){ return; }
|
|
|
|