|
Hi,
Thanks alot. After a week of searching, I found nothing of this publish option. This did create the correct dll and files that needed copied.
I do have another question though. When I copy the service files to another machine and create a project to access it in code, I create an object of type "MyService", and when I try to step through the code, when I run through one of the webservice functions, I get the debug error:
"Unable to automatically step into the server. Unable to determing a stopping location. Verify symbols are loaded. Breakpoints cannot be set in code that is optimized or has no symbols when the debugger option 'Just my code' is enabled."
First let me say, the function in the service did run successfully.
But, Shouldn't the test project just step through this function?
and
Is there any options I should be setting up in my webservice project before publishing? like debugger options?
Thanks for you help again. ChaciMulch
|
|
|
|
|
Hi again,
Glad to hear you managed to deploy the service ok, so I presume when say you've created a project to access it, you created a new project and added a web reference to your service?
I suspect the problem you are experiencing now is because you are trying to debug part on your local computer and part on the server. You can't step into the webservice as such as its running in a different process on a different computer. (Although apparently you can if you set remote debugging up - something I've never succeeded in getting to work).
If this is the case, best way forward is to run both the webservice and its calling program on your local computer and then when you're happy that it works ok, deploy the service to your server. If you look at the web reference you created, there is a property on it called 'Url Behavior', make sure this is Dynamic. Then if you look in the app.config of the calling program, you'll see a setting where you can specify the URL of the service. You can change this line to connect to either the local service or to connect to your deployed server version.
Web.config in your webservice project has what few debug options there are, but they're geared more to concealing you errors from your webservice consumers than helping you as a developer. Make sure customErrors is 'Off':
http://msdn2.microsoft.com/en-us/library/h0hfz6fc.aspx[^]
Hope that helps..
Regards,
Rob Philpott.
|
|
|
|
|
Ok. I got that stuff. I am using a web reference.
My question now is, I do not want to remote debug. I just want to step through the calling app. How do I get that error to stop coming up every time I'm stepping through the calling app and I call one of the WebService Functions? Or is this impossible when using a webservice?
Thanks again. Chaci Mulch
|
|
|
|
|
Can you not just step over (F10) rather than into (F11)?
Regards,
Rob Philpott.
|
|
|
|
|
Got it. Thanks so much. I have a way better understanding of this process now.
Chaci Mulch
|
|
|
|
|
Cool! Good luck with it....
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
i want some help with exporting detailsview to excell.I m working on a web application and i have a search page and a result page.The result page demonstrates the results of the search in a detailsview and i want to export it to excell.I use a button for that, the code of the button is :
protected void Button1_Click(object sender, EventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
// If you want the option to open the Excel file without saving then
// comment out the line below
//Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
DetailsView1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Confirms that an HtmlForm control is rendered for the specified ASP.NET
server control at run time. */
}
But i have an error message :
"RegisterForEventValidation can only be called during Render();
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: RegisterForEventValidation can only be called during Render();"
Any ideas?????It's very important
Thanks galatia
galatia
|
|
|
|
|
The RenderControl method is really only appropriate if you are planning to push your HTML out to some other output, such as a PDF rendering component. You probably want to generate a comma separated representation of your data (I'm assuming the DetailsView1 data soure is a DataView or a typed list of some sort). A comma separated file with a .xls extension opens as an Excel spreadsheet. You could do something of the form:
StringBuilder csv = new StringBuilder()<br />
foreach(DataRowView row in theDataView)<br />
{<br />
csv.Append(string.format("{0},{1},{2},{3}\n",row["col1"],row["col2"],row["col3"],row["col4"]);<br />
}<br />
Response.Write(csv.ToString());
|
|
|
|
|
Hi,
I want to delete nodes in XML the problem is I'm using deleteSelf() but only a few nodes are deleted and not all here is the code:
foreach (XPathNavigator nav in navigator.Select("//book[@title='"+title+"']"))
{
nav.DeleteSelf();
}
doc.Save(filename);
-- modified at 6:29 Thursday 28th September, 2006
|
|
|
|
|
I have a program I have written that launches other programs. What I am attempting to do (if it is possible), is have the "sub" programs close down if the main launching program closes.
here is the code I am using to launch:
<br />
proc = new Process();<br />
proc.EnableRaisingEvents = true;<br />
proc.StartInfo.FileName = "Notepad.exe";<br />
<br />
proc.Start();
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Okay, I dont know if this is "Best Practice" for this kind of thing, but I found somehting that works just dandy.
in the method that launches the process, I add the process id to an arraylist:
proc = new Process();<br />
proc.EnableRaisingEvents = true;<br />
proc.StartInfo.FileName = "Notepad.exe";<br />
<br />
proc.Start(); <br />
progList.Add(proc.Id);<br />
in the Form_Disposed method, i added the following:
for (int i = 0; i < progList.Count; i++)<br />
{<br />
Process[] p = Process.GetProcesses();<br />
<br />
foreach (Process pp in p)<br />
{<br />
if (pp.Id.ToString() == progList[i].ToString())<br />
{<br />
pp.Kill();<br />
}<br />
}<br />
}
Works like a charm.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
That's exactly how you have to do it. The system does not keep track of this for you. If you code launches another process, it's just another process to the system. It doesn't have a "Parent" property where if the parent closes, the children close too.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Im starting a batch file which runs a set of java classes. But when i start the batch file through a process, it pops up a Windows XP, "Do you want to Run this File" window. How would i hide/automatticly set this to run, as i dont want the user to know im running a batch file.
Regards,
Gareth.
|
|
|
|
|
ProcessStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden
only two letters away from being an asset
|
|
|
|
|
I've already hidden the Window, it still pops up the "Run" dialog.
Regards,
Gareth.
|
|
|
|
|
Is it being displayed by the packages you are trying to run?
only two letters away from being an asset
|
|
|
|
|
Your code can't turn this window off and can't skip it itself. It's a security setting on the users workstations that's causing it to pop up. The reason is that the code is being launched from an untrusted source, like a network share, and the system is telling the user that he's about to launch another process that he might not want launched.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
So i'd need to change the permissions of the batch file on the users pc?, If the batch file was included with an installer, e.g: the installer creates the file on the users PC, then as the user has created that file, wont it be trusted automatticly?
Regards,
Gareth.
|
|
|
|
|
gareth111 wrote: the installer creates the file on the users PC, then as the user has created that file, wont it be trusted automatticly?
There are no permissions to change to get this to work. Windows knows that the file didn't come from a local source, so it won't be truste, by default anyway. You can install it from an MSI, but even then, the MSI won't be trusted if it's comming from a network source.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Anyone know how to, or seen any articles on installing a printer programmatically? It is one of the standard drivers that comes with Windows XP. I would like to do it using C# and hopefully
use in a Deployment project.
Thanks,
Gerald.
Gerald Stanford
|
|
|
|
|
No by directly using the Win32 API, but by using WIndows' PrintUI.DLL. Just google for "printui.dll" and you'll come up with a bunch of information on how to use it from a command line.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi
i have many records in datagridview. i want to print these rows but how to print these rows in vs 2005??
thanks
|
|
|
|
|
The DataGridViewPrinter Class[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I would need a function to copy unsigned short values from a IntPtr to a ushort[]-array, but the Marshal.Copy-function only support the short[]-array!
At the moment I do it the following way:
<br />
... <br />
<br />
IntPtr pResult;<br />
int len;<br />
<br />
CanIpuExecCmd(mid, hid, did, data, data.Length, out pResult, out len);<br />
<br />
short[] tmp = new short[len];<br />
Marshal.Copy(pResult, tmp, 0, len);<br />
Marshal.FreeHGlobal(pResult);<br />
<br />
ushort[] result = new ushort[tmp.Length];<br />
System.Buffer.BlockCopy(tmp, 0, result, 0, len * 2);<br />
<br />
return result; <br />
Is there no nicer way to do it?
Regards,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|