|
I'm written a crazy simple service in C# and a simple class library that exposes 1 class. We're talking "hello world" simple here.
Here's the wierdness.
I have a reference to the class library from the service, when I attempt to start the service, I get an event log entry saying that it can't find the class library.
Event log record-->
Service cannot be started. System.IO.FileNotFoundException: Could not load file or assembly 'SampleClass, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'SampleClass, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at RemotingTest.TestService.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
What I've tried.
Create a console app using the same code -> Works
Remove the calls to the class library and start the service -> Works
uninstall the service/reinstall the service and start the service -> Fails.
Copy the class library dll to the windows system32 directory -> Fails.
????
Any ideas? I'm sure that it is something really stupid, but I can't think of it.
|
|
|
|
|
I suspect it has to do with security rights.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
|
I forgot all about Filemon...it showed me the error in my ways...., the service was looking for the class library in the obj\debug\ folder instead of the bin\debug folder which is where I put the dll. I still don't know why it didn't work when I put it in the system32 folder.
but at least I'm up and running....for now. <hehe>
thanks all.
|
|
|
|
|
I have problems passing parameters from C# application to XSL file and doing a transformation.
My code is below.:
XsltArgumentList xslArg = new XsltArgumentList();
String key = "grandpa/father/son"; // This is the name of node I want pass and gets it value
xslArg.AddParam("xslParam", "", key);
// Create the XslTransform and load the stylesheet.
XslTransform xslt = new XslTransform();
xslt.Load(stylesheet); // xsl stylesheet
XmlUrlResolver xmlUrlResolver = new XmlUrlResolver();
// Output to console.
XmlTextWriter writer = new XmlTextWriter(Console.Out);
// Transform the xml file
xslt.Transform(new XPathDocument(filename), xslArg, writer, xmlUrlResolver);
writer.Close();
----------------
XSL file looks like this
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="xslParam"/>
<xsl:template match="/">
<alku><xsl:value-of select="$xslParam"/></alku>
</xsl:template>
</xsl:stylesheet>
The problem is that node grandpa/father/son is not executed! It's passed to XSL file
but XslTransform classes transsform method does not fetch it's value from xml file.
It only shows the key value in console. Node grandpa/father/son has value in it's
xml file.
So, am I missing something or is there a bug in XsltArgumentList and it's transformation.
Has anyone any ideas what could be wrong?
Cheers!
|
|
|
|
|
|
I have a link on my webpage, when clicked upon it takes the user to a page where the website's home page is added to the favourites. Can someone please tell me where to go and look for this on MSDN. I would like to do it through C#. And also, maybe create a directory in My Favourites, and save the link in this directory.
Regards
ma se
|
|
|
|
|
hi, how can i create a nice look status bar in c# 2005?
how i can change look status bar?
Thx for your help.
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
|
|
|
|
|
|
ok thanks.
realy nice
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
|
|
|
|
|
Hi,
I've got a problem I can't solve, maybe I did the wrong searches on google for that !
I have some short and int values I want to put one behind the other in an existing byte array. In C++ i would have done a memcopy for each value passing the pointer to the byte array position I needed. Then, for reading, I would have done something like
int i = (int)b[3];
Now I have to do that in C#, and if possible using a way that would be as fast as the C++ way ... How can I do that ?
Thanks !
Stéphane
|
|
|
|
|
|
Hi there..
I wish to create a mutiview control and then want to dynamically add view cotrols to it while the webpage is displayed. The problem is that when I do this and run my webform, I get the following error:
ActiveViewIndex is being set to '0'. It must be smaller than the current number of View controls '0'. For dynamically added views, make sure they are added before or in Page_PreInit event.
I did create the view controls in the Page_Load() function and then added them to the Views property of the multiview Cotrol object..
How can I fix this...
Thank u!!
|
|
|
|
|
I have an sql table which one of its column data type is bit
How can I update it from c# app ?
Thanks
|
|
|
|
|
example
update tablename set columnbitvalue = 1 where idcolumn = 21;
same as
update tablename set columnbitvalue = '1' where idcolumn = 21;
you can update column which contain bit or integer giving update command as string, but u base in ur id for selected row which u want to update
|
|
|
|
|
Hello,
When l change the value of the combo box, as soon as the combo box loses focus the value will change to the value it was before. The new value does not remain. Has this got something to do with the edit options of the datagrid. I am not sure.
The only way l have solved this problem is to save the new value to the database, and then fill the datagrid from database again with the new. This has to be done everytime the user changes the combo box value.
The way l would like this to work is for the user to change the values in the combo boxes, and have the value remain. When they have finished, they can save everything to the database.
I hope you can help me with this project again. I have the code below that inserts the combo box into the datagrid.
<br />
if ( !this.grdCustomerProducts.TableStyles.Contains("Product") )<br />
{<br />
DataGridTableStyle grdTblStyle = new DataGridTableStyle();<br />
grdTblStyle.MappingName = dt.TableName;<br />
grdCustomerProducts.TableStyles.Add(grdTblStyle);<br />
<br />
GridColumnStylesCollection colStyle;<br />
colStyle = grdCustomerProducts.TableStyles["Product"].GridColumnStyles;<br />
colStyle[0].Width = 150;<br />
<br />
DataGridTextBoxColumn dgtb = (DataGridTextBoxColumn)grdCustomerProducts.TableStyles["Product"].GridColumnStyles[2];<br />
dgtb.TextBox.Controls.Add(cmbQuantities);<br />
}<br />
Thanks for you help in advance,
Steve
|
|
|
|
|
Hi,
I need a DataGridViewColumn With Radiobuttons like CheckBoxColumn in my application.
Immediate help will be appreciated
Srinivas
|
|
|
|
|
hi
You can use a template column to put a radio button control in your datagrid
Regards,
Lucky
|
|
|
|
|
Hi,
Thank You,
But I am working with Win Forms on VS 2005.
there is no template column in DataGridView.
are there any solutions?
Thanks
Srinivas
|
|
|
|
|
Hi:
please help i have a windows application connected to a local MSSQL server and i want to make the application to be used over lan, what sholud i change only the connection string so that it will work over lan and for more than one user.
please help and thanks for your time and consederation
|
|
|
|
|
Firstly, are you using Windows Security (trusted connection) or SQL Server security (you have a separate username and password for SQL Server)?
Does everyone who's going to use your application access SQL Server the same way? Do all your users have access to SQL Server?
These are the things that you need to determine before going forwards. If everyone in your workplace has a trusted connection to SQL Server and access to the DB, then you don't need to provide username and password information in your connection string. Otherwise, you'll have to get a username and password from each user (to include in the connection string) before they can get access to the SQL Server DB.
I hope this helps.
|
|
|
|
|
Hi,
I often end up with a collection of items I have to process. Say - an arraylist of "commands". I want to process these command and then delete the command from the collection. As you cannot modify a collection during a foreach, I often process it in reverse and delete the last (just processed) item like this
lock (col)
{
for (int i = col.count-1 ; i <=0 ; i--)
{
processItem(col[i]);
col.RemoveAt(i);
}
}
Is there a better way to do this ?
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concertp
|
|
|
|
|
Maybe something like that:
while(col.count > 0)
{
processItem(col[0]);
col.RemoveAt(0);
}
But I am not sure it is a better way
|
|
|
|
|
Jan R Hansen wrote: want to process these command and then delete the command from the collection.
Since processItem() doesn't know anything about the commands in the collection (other than the one it's processing), you might consider simply doing this:
lock (col) {
foreach (Command c in col)
processItem (c);
col.Clear();
}
If Command is a heavyweight object, you could try this approach:
lock (col) {
for (int i=0; (i < col.Count); i++) {
Command c = col[i] as Command;
processItem (c);
col[i] = null;
}
col.Clear();
}
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Thanks - I overlooked that I had to lock the collection anyway, so I could just as well use the topmost example. Thanks again !
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|