|
In a C# 2008 console application, I am getting the following error:
"Error 4 The type or namespace name 'eDataContext' could not be found (are you missing a using directive or an assembly reference?)".
I am getting this error on the following line of code:
eDataContext rptData = new eDataContext();
I have created the *.dbml file, I have dragged a table onto the designer surface, I have added the *.dbml file to the project folder that will be using the *.dbml file, and I have built the application.
The name 'eDataContext', in the name of the datacontext object that is located in the eD.designer.cs file.
The only thing that i can think to try is to add something in an app.config file, but I do not know what to add.
Thus can you tell me and/or point me to a reference on what i can do to solve this problem?
|
|
|
|
|
You must have missed importing the namespace. Find out what namespace eDataContext belongs to and import it in your code. For example, if eDataContext belongs to dcof.Entities namespace, you must write this line of code in the .cs file where you use the eDataContext class.
using dcof.Entities;
|
|
|
|
|
I have a piece of software that compiles and installs properly. It uses loosely coupled events to pass information to another application. All of the code works except for the other application actually receiving the event and processing it. It works on Windows XP perfectly but not on Windows 7.
Thanks
|
|
|
|
|
Without seeing any code, we can only offer guesses at best. It could be security related.
|
|
|
|
|
Due to company policy I can't post the code. If it were security related what would your best guess be. I have turned off UAC and ajusted permissions on many registry entries just to get it installed.
Thanks,
|
|
|
|
|
Well, for a start, I'd be using remote debugging on a debug version of the app installed on that machine and I'd check to see whether exceptions were being consumed. Also, is your LCE a COM event? If so, that can sometimes be a problem and you may have to adjust DCOM settings.
|
|
|
|
|
It is indeed a com event. I will have a look at DCOM settings. Thank you. If you have any specific suggestions let me know. Also if you can point me to a good remote debugging tutorial I would appreciate it. I am actually an Electrical Engineer with a a computer science degree and this is one of my first major coding projects and have never worked with com/com+/dcom before.
Thanks,
|
|
|
|
|
Good luck - this is pretty arcane stuff I'm afraid. Anyway, you should start here[^] for remote debugging.
|
|
|
|
|
I am beginning to realise this, have had so many issues over that last couple weeks just getting the majority of it working, now this last piece is taking forever.
Thanks for the help.
|
|
|
|
|
If it works on XP, but not on Windows 7, its most likely a security issue. Not necessarily a DCOM security issue, but one app being run under a different security context then the other. For example, one is running as a service and the other is a desktop app, or something like that.
|
|
|
|
|
One is running as a service and the other as a desktop type application, do you have suggestions on how to work around this?
Thanks,
|
|
|
|
|
Ha! Called it!
If you go into the service control panel, right click on your service & view the properties (Log On) tab... is it running as Local System? If so, you might need to turn on the interact w/ desktop checkbox. If that doesn't work, try run it as yourself (for testing).
|
|
|
|
|
That does not seem to have worked either. Both changing user and the desktop check box failed to succeed for me. It is a fairly complex program I am stuck with that uses MSMQ to talk across computers and then uses loosely coupled events to send the messages to another program which fires them out a serial port. Still hoping you have come more ideas.
Thanks,
|
|
|
|
|
Did you try tweak the security settings with dcomcnfg? Do you get any COM errors on the side that is sending the events?
|
|
|
|
|
I have been adjusting a few things in DCOMCnfg but with no success, I will check it all again in the morning, I have left the office for the day.
Thanks for all your help
|
|
|
|
|
Here are some errors I found in Event Viewer.
1.
General Tab
The COM+ Queued Components Player was unable to create an instance of a Queued Component. CPlayer BindToObject
Server Application ID: {2C3D0543-17EC-4FBA-92B9-AEAE22AF3BFB}
Server Application Instance ID:
{354D390F-B182-4CFC-8CD9-A66F09428921}
Server Application Name: StationQueue1
Error Code = 0x80004005 : Unspecified error
COM+ Services Internals Information:
File: d:\w7rtm\com\complus\src\comsvcs\qc\player\player.cpp, Line: 467
Comsvcs.dll file version: ENU 2001.12.8530.16385 shp
Log Name: Application
Source: Complus
Event ID: 4772
Level: Error
User: N/A
OpCode: Info
Logged: 9/6/2012 11:29:19 AM
Task Category: QC Player
Keywords: Classic
Computer: My Computer
Details Tab
+ System
- Provider
[ Name] Microsoft-Windows-Complus
[ Guid] {0f177893-4a9c-4709-b921-f432d67f43d5}
[ EventSourceName] COM+
- EventID 4772
[ Qualifiers] 49154
Version 0
Level 2
Task 26
Opcode 0
Keywords 0x80000000000000
- TimeCreated
[ SystemTime] 2012-09-06T16:29:19.000000000Z
EventRecordID 2228
Correlation
- Execution
[ ProcessID] 0
[ ThreadID] 0
Channel Application
Computer WIN-BMLLA06V4GM
Security
- EventData
param1 CPlayer BindToObject Server Application ID: {2C3D0543-17EC-4FBA-92B9-AEAE22AF3BFB} Server Application Instance ID: {354D390F-B182-4CFC-8CD9-A66F09428921} Server Application Name: StationQueue1 Error Code = 0x80004005 : Unspecified error COM+ Services Internals Information: File: d:\w7rtm\com\complus\src\comsvcs\qc\player\player.cpp, Line: 467 Comsvcs.dll file version: ENU 2001.12.8530.16385 shp
2.
General Tab
DCOM got error "1068" attempting to start the service netman with arguments "" in order to run the server:
{BA126AD1-2166-11D1-B1D0-00805FC1270E}
Log Name: System
Source: Distributed COM
Event ID: 10005
Level: Error
User: N/A
OpCode: Info
Logged 9/6/2012 11:29:35 AM
Task Category: None
Keywords: Classic
Computer: My Computer
Details Tab
+ System
- Provider
[ Name] Microsoft-Windows-DistributedCOM
[ Guid] {1B562E86-B7AA-4131-BADC-B6F3A001407E}
[ EventSourceName] DCOM
- EventID 10005
[ Qualifiers] 49152
Version 0
Level 2
Task 0
Opcode 0
Keywords 0x80000000000000
- TimeCreated
[ SystemTime] 2012-09-06T16:29:35.000000000Z
EventRecordID 5098
Correlation
- Execution
[ ProcessID] 0
[ ThreadID] 0
Channel System
Computer WIN-BMLLA06V4GM
Security
- EventData
param1 1068
param2 netman
param3
param4 {BA126AD1-2166-11D1-B1D0-00805FC1270E}
3.
General
DCOM got error "1068" attempting to start the service netprofm with arguments "" in order to run the server:
{A47979D2-C419-11D9-A5B4-001185AD2B89}
Log Name: System
Source: Distributed COM
Event ID: 10005
Level: Error
User: N/A
OpCode: Info
Logged 9/6/2012 11:29:31 AM
Task Category: None
Keywords: Classic
Computer: My Computer
|
|
|
|
|
I am trying to have a new C# 2010 console application execute an existing C# 2008 console application using the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.ComponentModel;
namespace ClientScripts
{
class RunRPT
{
static void Main(string[] args)
{
Process e_Process = new Process();
try
{
e_Process.StartInfo.UseShellExecute = false;
e_Process.StartInfo.FileName = "C:\\eclient\\bin\\Debug\\Eclient.exe encriptvalue";
eRPT_Process.StartInfo.Arguments = "http://test1 1 SUB";
eRPT_Process.Start();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
I am getting the following error message: {System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at system.Diagnostics.Process.Start().
The console app that I am trying to call does run from a dos prompt command if you are in the correct directory running the following command:
Start .\eclient\bin\Debug\Eclient.exe encriptvalue http:
Thus can you tell me what parameters I would need to change in the process class for this execute to work? If you have any other ideas I can use to make this work, can you tell me what they would be?
|
|
|
|
|
You have one of your parameters at the end of the StartInfo.FileName . That should be in the Arguments .
|
|
|
|
|
5 for the answer, 50 for the patience.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Thanks Wes. I just try to remember that I was once like this. It's easy to miss the little things, so I try not to get too bad with them.
|
|
|
|
|
I have an ISP that to say the least is not very helpful. I want to move to another ISP but need a backup of my database. Their Plesk database backup option is not work, and despite ticket after ticket I cannot get them to let me get a backup.
So I decided to do my own backup. The problem is I need the backup to backup to the local system, as their MS SQL box is not on the same machine as my web site. I have no idea how their local folder structure works but when I pull the current folder (see below) then folder is in the inetsrv folder.
I have a textbox (tbxFileName) that i populate to try and save the database but keep getting an error.
Can any one help. Code below:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
string s = System.IO.Directory.GetCurrentDirectory();
tbxFileName.Text = s + "\\dbbackup";
}
}
protected void btnDoBackup_Click(object sender, EventArgs e)
{
try
{
string destDir = tbxFileName.Text;
string StrConString = System.Configuration.ConfigurationManager.ConnectionStrings["MyDBConnString"].ToString();
SqlConnection sqlcon = new SqlConnection(StrConString);
SqlCommand sqlcmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataTable dt = new DataTable();
if (!System.IO.Directory.Exists(destDir))
{
System.IO.Directory.CreateDirectory(destDir);
}
sqlcon.Open();
sqlcmd = new SqlCommand("backup database test to disk='" + destDir + "\\DBBackup" + DateTime.Now.ToString("ddMMyyyy_HHmmss") + ".Bak'", sqlcon);
sqlcmd.ExecuteNonQuery();
sqlcon.Close();
ltrlMsg.Text = "Backup database successfully";
}
catch (Exception exp)
{
ltrlMsg.Text = "ERROR: " + exp.Message;
}
}
This the error I get if I try and run the above it fails at the exists folder point
Quote: ERROR: Access to the path 'c:\windows\system32\inetsrv\dbbackup' is denied.
|
|
|
|
|
The error is what I would expect. You normally don't have write permissions to the filesystem from an ASP.NET application and the SQL Service account doing the backup on the SQL box probably is not going to have any permissions to any other boxes filesystem either.
You have to supply a folder path on the SQL server to write the backup to, NOT on the IIS box. Chances are really good you're not going have permissions to write the backup anywhere at all!
It's a good bet that you can't do this without the ISP's cooperation.
|
|
|
|
|
Hi thanks for the reply. I am aware as to what the error means. The problem is that I want to save a backup. I cannot get access to the ISPs SQL box, I populate the current folder for interest sake, but want to save into a folder on a client or alternative machine.
So how is that done?
|
|
|
|
|
You CAN NOT do it! The service account that is running the SQL Server on the SQL box does NOT have permissions to other boxes! If the account cannot log in to other boxes, it can NOT write the boxup file on them.
Again, you can NOT do this without the help of the ISP since they control all the security permissions!
The ISP's SQL Server will NEVER have permissions to your client machines. You can forget about writing the backup file to them. There's a 99% chance that the SQL Server will only EVER be able to write the backup file to a folder on the SQL Server itself and the ISP will have to hand that file over to you. You can NOT do this without their help.
|
|
|
|
|
Okay I will ask them for a local path that I can have write privileges to, but after waiting 3 months for them to sort out their plesk system to allow backup, I am not living in hope.
Is there no way this can be done to say an FTP site. I have an FTP at the same ISP.
|
|
|
|