I just checked the TestResults folder. It turns out that when you run a test, the Test system creates a new folder under the TestResults folder for your solution and copies the files from the test project's bin\Debug folder (if you're running in debug mode) into the Out folder of the new test specific folder.
And it's not copying the DevArt dlls, even though they're in the test project's bin\Debug folder. I've checked the settings for the 3 Devart DLLS that are used & they're set to Copy Always.
If anybody knows how I can get VS 2010 to copy these DLLs, I'd love to hear it.
In any event, if I put a breakpoint earlly in my test & manually copy the DLLs into the Out folder, it all works fine.
Tony
Search found 74 matches
- Fri 14 Oct 2011 21:06
- Forum: dotConnect for PostgreSQL
- Topic: AspNetPgSqlMembershipProvider configuration issue
- Replies: 4
- Views: 1203
- Fri 14 Oct 2011 20:52
- Forum: dotConnect for PostgreSQL
- Topic: AspNetPgSqlMembershipProvider configuration issue
- Replies: 4
- Views: 1203
AspNetPgSqlMembershipProvider configuration issue
I have an application that runs as a Windows service which needs to make calls to the DevArt ASPNET Membership provider. I've got an app.config file in the project with the following content:
I took most of the file's contents from the app.config for another program I have that uses this same code and just tweaked it as necessary.
To test the code, we have a number of unit tests set up. I am debugging the code in the service through the unit test. To be clear, the app.config file is in the service project, not the test project. The module being tested has a property called CurrentUserName, which is included below:
When I single step through the code, a FileNotFound exception is thrown on the "MembershipUser user = Membership.GetUser( iCurrentUserName );" line.
I checked the properties on the Devart.Data.PostgreSql.Web.dll file and they are set to Copy if newer. Is something wrong with my app.config or is it some other problem?
Tony[/quote]
Code: Select all
To test the code, we have a number of unit tests set up. I am debugging the code in the service through the unit test. To be clear, the app.config file is in the service project, not the test project. The module being tested has a property called CurrentUserName, which is included below:
Code: Select all
public string CurrentUserName {
get { return iCurrentUserName; }
set {
iCurrentUserName = value;
if ( ! string.IsNullOrEmpty( iCurrentUserName ) && ! string.IsNullOrWhiteSpace( iCurrentUserName ) ) {
MembershipUser user = Membership.GetUser( iCurrentUserName );
if ( user == null ) {
Log( string.Format( "User \"{0}\" is not a registered user. Cannot proceed with this user.", CurrentUserName ), EventTypeEnum.Error );
// Set the current user name to the empty string and the current domain ID to null
iCurrentUserName = string.Empty;
CurrentDomainId = null;
}
if ( user.IsLockedOut ) {
string msg = string.Format( "User \"{0}\" is currently locked out. Cannot proceed with this user.", CurrentUserName );
Log( msg, EventTypeEnum.Error );
iCurrentUserName = string.Empty;
CurrentDomainId = null;
}
CurrentUser = CarSystemUser.Attach( user, true );
UserProfile = CurrentUser.UserProfile;
UserProfile.Save();
CurrentDomainId = UserProfile.DomainId;
}
}
}
I checked the properties on the Devart.Data.PostgreSql.Web.dll file and they are set to Copy if newer. Is something wrong with my app.config or is it some other problem?
Tony[/quote]
- Wed 12 Oct 2011 18:37
- Forum: dotConnect for PostgreSQL
- Topic: Create a method in Entity Developer for a postgres function
- Replies: 2
- Views: 1481
Create a method in Entity Developer for a postgres function
I have a stored function in my Postgres database that looks like this:
When I run the Update Model from Database wizard I check off this function to be imported into the Model. But there's no method for it. If I try to right click and select "Create Method", or if I drag the function onto the design surface, I get the following error:
I want to be able to execute this stored proc from code through the entity model. How do I do this?
Tony
Code: Select all
CREATE OR REPLACE FUNCTION "CarSystem"."ScanLists"( OUT RowCount INT ) RETURNS INT
AS $$
...
Code: Select all
Cannot create method for a storage function 'ScanLists' that can be composed. Only stored procedures can be mapped."
Tony
- Wed 12 Oct 2011 15:07
- Forum: dotConnect for PostgreSQL
- Topic: What does this message mean?
- Replies: 9
- Views: 1688
Thanks, but now what?
Shalex:
Thank you very much! That did indeed fix that issue. However, I am now getting another message:
No mapping specified for the following EntitySet/AssociationSet - ImageTypes_ImagesSet.
How do I fix this issue? I tried to add a mapping to the association and I can't because the ImageTypeId property is gone from the Image entity class.
Thanks
Tony
Thank you very much! That did indeed fix that issue. However, I am now getting another message:
No mapping specified for the following EntitySet/AssociationSet - ImageTypes_ImagesSet.
How do I fix this issue? I tried to add a mapping to the association and I can't because the ImageTypeId property is gone from the Image entity class.
Thanks
Tony
- Tue 11 Oct 2011 13:16
- Forum: dotConnect for PostgreSQL
- Topic: What does this message mean?
- Replies: 9
- Views: 1688
What does this message mean?
I have an Entity Model for my code. There's one table, called Images, which has the following definition:
There are 2 different types of images: Overviews & Plates. The ImageTypeId is used to tell these apart.
In the Entity Developer, I selected the OrigX, OrigY, Width, and Height columns and dragged them out onto the design surface. I chose to make them a Derived Class, called PlateImage. After completing these tasks, I got the error below:
Problem in mapping fragments starting at lines 143, 177:Two entities with different keys are mapped to the same row. Ensure these two mapping fragments do not map two groups of entities with different keys to the same group of rows.
What does this message mean? How do I correct it?
Thanks
Tony
Code: Select all
CREATE TABLE "CarSystem"."Images" (
"ImageId" UUID PRIMARY KEY DEFAULT UUID_GENERATE_V4(),
"ReadId" UUID NOT NULL REFERENCES "CarSystem"."Reads" ( "ReadId" ),
"ImageTypeId" INT NOT NULL REFERENCES "CarSystem"."ImageTypes" ( "ImageTypeId" ),
"ImageClassId" INT NOT NULL REFERENCES "CarSystem"."ImageClasses" ( "ImageClassId" ) DEFAULT 3,
"ImageOid" INT NOT NULL,
"OrigX" INT NULL,
"OrigY" INT NULL,
"Width" INT NULL,
"Height" INT NULL,
"Camera" VARCHAR(16) NULL,
"TimeStamp" TIMESTAMPTZ NOT NULL,
"CreatedDate" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
i_active SMALLINT NOT NULL DEFAULT 1,
"ModifyDate" TIMESTAMPTZ NULL
);
In the Entity Developer, I selected the OrigX, OrigY, Width, and Height columns and dragged them out onto the design surface. I chose to make them a Derived Class, called PlateImage. After completing these tasks, I got the error below:
Problem in mapping fragments starting at lines 143, 177:Two entities with different keys are mapped to the same row. Ensure these two mapping fragments do not map two groups of entities with different keys to the same group of rows.
What does this message mean? How do I correct it?
Thanks
Tony
- Tue 04 Oct 2011 19:19
- Forum: dotConnect for PostgreSQL
- Topic: Postgres Stored procedures and Entity Developer
- Replies: 1
- Views: 978
Nevermind
I've got this working now.
At one point, I had defined the functions as returning a value other than void. To make it work, I had to change the return type on the procedure dialog in Entity Developer to (None). After that, I just had to get the parameters mapped to the properties & it all is fine.
Tony
At one point, I had defined the functions as returning a value other than void. To make it work, I had to change the return type on the procedure dialog in Entity Developer to (None). After that, I just had to get the parameters mapped to the properties & it all is fine.
Tony
- Tue 04 Oct 2011 18:15
- Forum: dotConnect for PostgreSQL
- Topic: Postgres Stored procedures and Entity Developer
- Replies: 1
- Views: 978
Postgres Stored procedures and Entity Developer
I have an Entity Model for my database. I want to add stored procedures for inserting, updating, and deleting rows from certain tables. I can't get entity developer to list my stored procedures in the Behavior dialog.
Here's a sample of a stored procedure I've written:
This stored function shows up under "Stored Procedures", but I cannot do anything with it in the model.
What am I doing wrong?
Thanks
Tony
Here's a sample of a stored procedure I've written:
Code: Select all
CREATE OR REPLACE FUNCTION "CarSystem"."InsertList"( ListName VARCHAR(50), ListTypeId INT, DomainId INT, Geofencing VARCHAR, Salt VARCHAR(50), WhiteListAlarmClassId INT ) RETURNS VOID AS $$
INSERT INTO "CarSystem"."Lists"
( "ListName", "ListTypeId", "DomainId", "LastUpdate", "Geofencing", "Salt", "WhiteListAlarmClassId" )
VALUES
( $1, $2, $3, NOW(), $4, $5, $6 );
$$ LANGUAGE SQL;
What am I doing wrong?
Thanks
Tony
- Wed 21 Sep 2011 21:01
- Forum: dotConnect for PostgreSQL
- Topic: Issue with ASP .NET Profile Provider in WPF program
- Replies: 8
- Views: 2406
Looks good!
I have downloaded and installed the 6-Sep-2011 version of the dotConnect libraries. Now that my problem with access a version 9.0.4 server with the new DLLs is fixed, I've updated the table designs to use UUIDs for the UserId and RoleId columns in the aspnet_Xxxx tables.
I'm happy to report that all code is working 100%. Thanks!
Tony
I'm happy to report that all code is working 100%. Thanks!
Tony
- Wed 21 Sep 2011 20:59
- Forum: dotConnect for PostgreSQL
- Topic: Upgraded to Sep 06 release and can't log in to database
- Replies: 3
- Views: 1022
Problem is resolved
Since I posted the question, I have uninstalled PostgreSQL version 9.0.4 and reinstalled it. Everything is working fine now. I dont' know what was wrong with the configuration I had on this machine originally, but whatever it was, it's back to normal now.
Tony
Tony
- Fri 16 Sep 2011 19:45
- Forum: dotConnect for PostgreSQL
- Topic: Upgraded to Sep 06 release and can't log in to database
- Replies: 3
- Views: 1022
Interesting test results
I have installed PostgreSQL 9.1 on my machine, without uninstalling 9.0.4. The 9.1 install uses port 5433 to connect to it.
I created an empty copy of my database on the 9.1 server, and then I ran Entity Developer & created a new Data Model. In the Connection dialog, I specified the 9.1 port. I'm able to connect to the 9.1 server without problems but I still can't connec to the 9.0.4 server.
So it seems this is a backwards compatibility issue with the database driver. As my code is still in development, I'll just upgrade my server to 9.1 and be done with it. However, it would be nice if you could access previous releases of the server with this version of the dotConnect library.
I mean, once this is in production, I don't want to tell my users they have to upgrade postgres on their systems in addition to upgrading our software.
Tony
Tony
I created an empty copy of my database on the 9.1 server, and then I ran Entity Developer & created a new Data Model. In the Connection dialog, I specified the 9.1 port. I'm able to connect to the 9.1 server without problems but I still can't connec to the 9.0.4 server.
So it seems this is a backwards compatibility issue with the database driver. As my code is still in development, I'll just upgrade my server to 9.1 and be done with it. However, it would be nice if you could access previous releases of the server with this version of the dotConnect library.
I mean, once this is in production, I don't want to tell my users they have to upgrade postgres on their systems in addition to upgrading our software.
Tony
Tony
- Fri 16 Sep 2011 14:49
- Forum: dotConnect for PostgreSQL
- Topic: Upgraded to Sep 06 release and can't log in to database
- Replies: 3
- Views: 1022
Upgraded to Sep 06 release and can't log in to database
I recently upgraded to the Sep 06 2011 release of dotConnect for PostgreSQL. After upgrading the projects in my solution to the new DLLs, my code can no longer connect to the database.
I even tried upgrading my Entity Framework model from the database and now Entity Framework will not connect.
The connection string my code uses is: User Id=CarSystem;Password=ELSAGelsag;Host=BREW-LAB-04;Database=CarSystem;Persist Security Info=True;Schema='"CarSystem"'
The error I'm getting is "Unexpected server response". I've verivied that the server is up & running. I'm using PostgreSql 9.04 64 bit server.
Help!
Tony
I even tried upgrading my Entity Framework model from the database and now Entity Framework will not connect.
The connection string my code uses is: User Id=CarSystem;Password=ELSAGelsag;Host=BREW-LAB-04;Database=CarSystem;Persist Security Info=True;Schema='"CarSystem"'
The error I'm getting is "Unexpected server response". I've verivied that the server is up & running. I'm using PostgreSql 9.04 64 bit server.
Help!
Tony
- Fri 26 Aug 2011 19:22
- Forum: dotConnect for PostgreSQL
- Topic: Keep getting socket exceptions when DbMonitor is not running
- Replies: 4
- Views: 1247
That's it
I did change the Debug settings to break when CLR exceptions are thrown! I completely forgot about it!
I'll turn that setting off. That will fix it!
Thanks again!
Tony
I'll turn that setting off. That will fix it!
Thanks again!
Tony
- Fri 26 Aug 2011 15:59
- Forum: dotConnect for PostgreSQL
- Topic: Keep getting socket exceptions when DbMonitor is not running
- Replies: 4
- Views: 1247
So this is normal?
So what you're saying is the behavior I'm seeing now is normal and the behavior I saw in the past (where the program would run without complaining if dbMonitor wasn't running) isn't normal?
OK, I'll buy that. I suppose I can put the call into a try-catch block & just ignore the exception. And I can put the call to instantiate the object into a #if DEBUG....#endif block so it won't get called in release.
Does that sound OK?
Tony
OK, I'll buy that. I suppose I can put the call into a try-catch block & just ignore the exception. And I can put the call to instantiate the object into a #if DEBUG....#endif block so it won't get called in release.
Does that sound OK?
Tony
- Thu 25 Aug 2011 18:15
- Forum: dotConnect for PostgreSQL
- Topic: Keep getting socket exceptions when DbMonitor is not running
- Replies: 4
- Views: 1247
Keep getting socket exceptions when DbMonitor is not running
I'm developing an application that uses dotConnect for PostgreSql and the Linq To Entities Framework 4. I built the entity model using Entity Developer.
When I first started on this application, the program would run fine, even if DbMonitor wasn't running. However, about 2 weeks ago, the program started dying if DbMonitor wasn't started. I was trying to fix an issue with the program not running under XP (I have another thread about that issue, and it's still not resolved, by the way).
Since then, I don't know what I did, but now the program generates the following socket exception whenever I start it & DbMonitor is not running:
No connection could be made because the target machine actively refused it 127.0.0.1:1000
I need to fix this as DbMonitor will not be installed on client machines when the program goes to production.
How do I fix the program so this error no longer occurs?
Thanks
Tony
When I first started on this application, the program would run fine, even if DbMonitor wasn't running. However, about 2 weeks ago, the program started dying if DbMonitor wasn't started. I was trying to fix an issue with the program not running under XP (I have another thread about that issue, and it's still not resolved, by the way).
Since then, I don't know what I did, but now the program generates the following socket exception whenever I start it & DbMonitor is not running:
No connection could be made because the target machine actively refused it 127.0.0.1:1000
I need to fix this as DbMonitor will not be installed on client machines when the program goes to production.
How do I fix the program so this error no longer occurs?
Thanks
Tony
- Tue 23 Aug 2011 14:52
- Forum: dotConnect for PostgreSQL
- Topic: PostgreSQL LINQ to Entities Framework model not working
- Replies: 12
- Views: 2676
app.config
I couldn't find any "attach file" button on the post. I guess it's because the code section I inserted in the first post made the posts too wide for the page design.
Here's the app.config as plain text.
Here's the app.config as plain text.
Code: Select all
-->
-->
1234
80fdc536-581a-4ee2-8563-cfba2fa6e94a
Car54
Car54
False