|
It's not release code if you use csc /debug . If you want to do the release build that you get with Visual Studio, just use csc.exe /optimize+ /debug:pdbonly . To just produce the release build without the pdb, just use csc.exe /optimize+ .
|
|
|
|
|
The compiler will know what to create easy enough.
My problem is with optimizations and code rewrite, are the line numbers going to be accurate??
|
|
|
|
|
I need to create a help file for an application. Not code comments but actual "how to use" help file for end users.
Which "tool" should I use?
Which tool have you used? Did you think it was good? Why?
Which tool shouldnt I use? Why not?
Thanks
bart
|
|
|
|
|
This isn't really an appropriate question for the C# forum. What you could do is download and test some of the help authoring tools to see which best suits your requirements.
|
|
|
|
|
Can you suggest a better forum?
bart
|
|
|
|
|
Possibly the lounge. And rather than post your question like this, I'd rephrase it to be a more general "does anyone have any experience with help authoring tools? I'm interested in which tools people have used to write documentation for end users, rather than API style documentation, and how they found them."
|
|
|
|
|
so you will answer in the lounge? Without any elephants?
bart
|
|
|
|
|
Some might - when you post, put in that I suggested that you posted there.
|
|
|
|
|
Good point.
We "use" Microsoft HTML Help Workshop 1.3 - it's old, and it's not good to use. (And we hardly ever use it, our help files are really outdated).
At a different company, the documentation guys used RoboHelp. It allowed for better help integration than the HTML Workshop, you could generate context-sensitive help downto the controls on a form. But I do not know how hard it is to use.
|
|
|
|
|
These days I just create HTML pages and have the F1 link point a browser at it. The classic .hlp type help is no longer supported under recent Windows, and .chm help is just HTML but annoying to use.
|
|
|
|
|
My project was created in winxp and now migrated to windows7. I am getting a weird exception while click on the openfiledialog icon in my project and the application crashes after this. This only happens when I create a release build and install that build in windows 7.
The setup is also created in the windows 7. I do no get this exception when run the code in the debug mode.
I am setting the initialdirectory property of the openfiledialog to desktopdirectory.
Below is the exception trace i caught in the windows event viewer.
Application: projectname.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at System.Windows.Forms.UnsafeNativeMethods.GetOpenFileName(OPENFILENAME_I)
at System.Windows.Forms.OpenFileDialog.RunFileDialog(OPENFILENAME_I)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPtr)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr)
at System.Windows.Forms.CommonDialog.ShowDialog(System.Windows.Forms.IWin32Window)
at System.Windows.Forms.CommonDialog.ShowDialog()
at companyname.projectname.MainForm.processFileOperation(FileOperationType)
at companyname.projectname.MainForm.fileOpenMenuItem_Click(System.Object, System.EventArgs)
at companyname.projectname.MainForm.toolBar_ButtonClick(System.Object, System.Windows.Forms.ToolBarButtonClickEventArgs)
at System.Windows.Forms.ToolBar.OnButtonClick(System.Windows.Forms.ToolBarButtonClickEventArgs)
at System.Windows.Forms.ToolBar.WmReflectCommand(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ToolBar.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(System.Runtime.InteropServices.HandleRef, Int32, IntPtr, IntPtr)
at System.Windows.Forms.Control.SendMessage(Int32, IntPtr, IntPtr)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr, System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WmCommand(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.DefWndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WmMouseUp(System.Windows.Forms.Message ByRef, System.Windows.Forms.MouseButtons, Int32)
at System.Windows.Forms.Control.WndProc
(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ToolBar.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
at System.Windows.Forms.Application
+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
at System.Windows.Forms.Application.Run(System.Windows.Forms.Form)
at companyname.projectname.MainForm.Main(System.String[])
|
|
|
|
|
This is not caused by a building a release-mode or creatng a setup on Windows 7. First, you'll need to implement an event[^] to deal with "unhandled exceptions". Next, you'd need to debug to find out the cause of the exception; my guess is that the filename or the path is mukking up things.
Can you post the code that calls your dialog? And the filename/path that you select? And the initial directory you try to set?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
<pre lang="c#">OpenFileDialog dlg = new OpenFileDialog();
#endregion
#region DIALOG BOX SETTINGS
string previousOpenFilePath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
dlg.RestoreDirectory = true;
dlg.DefaultExt = ".xml";
dlg.Filter = "XML Document (*.xml)|*.xml|Excel File (*.xls)|*.xls|Excel File (*.xlsx)|*.xlsx|VPI File (*.vpi)|*.vpi|All Files (*.*)|*.*";
#endregion
dlg.CheckPathExists = true;
dlg.CheckFileExists = true;
if (dlg.ShowDialog() == DialogResult.OK)
Here the exception comes at the showdialog call. The stacktrace goes in eventviewer.
|
|
|
|
|
Looks good
..and how does the filename/initial path look like?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello!
I created a process containing a NamedPipeServerStream and second process NamedPipeClientStream.
I managed to establish communication between both processes on the same server. Is also worked on two different computers over the network, after I created the same USER and Password on both computers.
But it only worked, if after i assigend the group "Administartors" to the users. Is it possible to establish connection between without beeing Administrator?
My first Try:
NamedPipeServerStream m_PipeServerStream = new NamedPipeServerStream(
Properties.Settings.Default.PIPE_NAME
, PipeDirection.InOut
, SERVER_THREADS
, PipeTransmissionMode.Byte
, PipeOptions.Asynchronous
, BUFFER_SIZE_kB
, BUFFER_SIZE_kB);
if (Properties.Settings.Default.SERVER_USER.Count > 0)
{
foreach (string item in Properties.Settings.Default.SERVER_USER)
{
m_PipeServerStream.GetAccessControl().AddAccessRule(new PipeAccessRule(
item
, PipeAccessRights.ReadWrite
, System.Security.AccessControl.AccessControlType.Allow));
}
}
|
|
|
|
|
True_Posi wrote: Is it possible to establish connection between without beeing Administrator?
It is according to the docs[^]; take a look at the end of the page, the section called "community content".
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
According to docs you linked, i added the following code to my Server:
PipeAuditRule auditRule = new PipeAuditRule("Everyone", PipeAccessRights.FullControl, AuditFlags.Failure);
PipeAccessRule accessRule = new PipeAccessRule("Everyone", PipeAccessRights.FullControl, AccessControlType.Allow);
m_PipeServerStream.GetAccessControl().AddAuditRule(auditRule);
m_PipeServerStream.GetAccessControl().AddAccessRule(accessRule);
But the user must still be an "Administrator".
The Server application runs on a Windows Server 2008 R2 and the client on Windows 7.
|
|
|
|
|
Did you get an exception? I'm wondering whether it's that particular code that requires admin-permission; does the bare-bones example ask for the same permissions?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
 I think it simply does not connect (as far as i found out).
I also tried it with an AccessRole of a usergroup, i created only for users of my server. it does not work.
Code from the Server thread (As it works as with absolutely equal user accounts):
private void NMP_ServerThread()
{
int threadId = Thread.CurrentThread.ManagedThreadId;
try
{
NamedPipeServerStream m_PipeServerStream = new NamedPipeServerStream(
Properties.Settings.Default.PIPE_NAME
, PipeDirection.InOut
, SERVER_THREADS
, PipeTransmissionMode.Byte
, PipeOptions.Asynchronous
, BUFFER_SIZE_kB
, BUFFER_SIZE_kB);
Console.WriteLine(string.Format("SERVER: Thread {0} :Waiting for child process connection...", threadId));
pipeServerInstancePool.Add(threadId, m_PipeServerStream);
this.State = ServerState.Started;
pipeServerInstancePool[threadId].WaitForConnection();
if (pipeServerInstancePool[threadId].IsConnected)
{
NMPEventArgs args = new NMPEventArgs();
args.State = ClientState.Conneceted;
RaiseOnClientSateChanged(this, args);
while (State == ServerState.Started && pipeServerInstancePool[threadId].IsConnected)
{
StartAsyncReceive(threadId);
}
}
}
catch (ObjectDisposedException)
{
this.State = ServerState.Closed;
}
catch (IOException)
{
this.State = ServerState.Closed;
}
RaiseOnClientThreadFinished(this, new ClientThreadFinishedArgs(threadId));
}
Client Thread:
private void NMP_ClientThread()
{
pipeClient = new NamedPipeClientStream(
Properties.Settings.Default.PIPE_SERVER
, Properties.Settings.Default.PIPE_NAME
,PipeDirection.InOut
,PipeOptions.Asynchronous
,TokenImpersonationLevel.Impersonation);
try
{
try
{
pipeClient.Connect();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
if (pipeClient.IsConnected)
{
RaiseOnStateChanged(this, new StateChangedEventArgs(ClientState.CONNECTED));
}
while (stopClient == false && pipeClient.IsConnected == true)
{
StartAsyncReceive();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
RaiseOnConnectionLost(this, new EventArgs());
}
|
|
|
|
|
Hi all!
I've got a problem with a where clause in a subcollection, the situation is like this.
I've got a collection of schools, in that collection there's an other collection of students. I want to perform a where clause in de student collection.
So, its like this:
List<schools>
- Id: Guid
- Name: string
- Address: string
- Director: string
- List<students> (- Id: Guid, - Age: int, - Address: string, - Study: string)
I want to do something like this (which doesn't work... ), so I only pass all the schools with all the students who study IT.
CheckStudents(School.Where(s => s.Students.Where(s => s.Study == "IT")))
The method signature CheckStudents looks like this: CheckStudents(List<schools>)
Can anyone help me out on this?
Thanks in advance!
|
|
|
|
|
Are your collections actual .Net classes or are they themselves just lists ? It is not clear the way you have structured your question.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Off the top of my head, you should be able to use the Any clause in place of the inner Where , and you need to apply .ToList() at the end to convert it from a query into a concrete collectino.
|
|
|
|
|
Query methods are only for selecting or creating objects, not modifying them. So you can't pass school objects with the student list modified to only contain students studying IT, unless you create a new School.
I think you want CheckStudents to take the list of schools and the subject:
void CheckStudents(IEnumerable<School> schools, string subject){
foreach(School school in schools){
var students = school.Students.Where(s => s.Study == "IT");
}
}
Or if you want to filter the schools you can do
CheckStudents(School.Where(s => s.Students.Any(s => s.Study == "IT")))
... but you still need to have the students within a school filtered in a separate query.
|
|
|
|
|
hello all,
how to convert HTML file to Excel in C# without using any thirt party tool.
Thanks
|
|
|
|
|
Rename it to .xls, and open it in Excel. Presto! Alternatively, you could use ADO.NET (you can look up the connectionstring here[^]).
Those techniques are limited, in the sense that they work with raw data, and not with the Excel DOM; for that you do need a third-party library, or contact Microsoft and write your own.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|