|
Hi there,
I'm using Nhibernate 2.0 and I get a "collection was modified enumeration operation might not execute" exception when NHibernate is in debug mode.
Here is the context (parent / childs relations with lazy loading) :
HelpCategory
---- HelpCategoryLocalized (categories's localized texts)
---- HelpItem (collection of childs items)
-------- HelpItemLocalized (items's localized texts)
I already spent hours and hours to found a solution by myself and with Google but I'm still stuck... and it's really gonna make me crazy
I finally downloaded then debugged NHibernate's source, the exception is thrown "from" the NHibernate.Impl.Printer class whose goal is (stop me if I'm wrong) to show proxied entities in logs (when the NHibernate transaction is commited)
All right, but when I modify and save a HelpCategory entity :
1) the childs HelpItem are proxied but not the HelpItemLocalized before entering the do ... while loop
2) the log.Debug(ToString(enumerator.Current, entityMode)) call load all fields of proxied entities => this behaviour make HelpItemLocalized entities to get proxied IN the loop ! => the collection is changed and throw the exception
Does anyone can tell me if I'm wrong (I use <bag> and <many-to-one> to make the relations) or if it's an NHibernate bug ?
Best regards,
public void ToString(IEnumerator enumerator, EntityMode entityMode)
{
if (!log.IsDebugEnabled || !enumerator.MoveNext())
{
return;
}
log.Debug("listing entities:");
int i = 0;
do
{
if (i++ > 20)
{
log.Debug("more......");
break;
}
log.Debug(ToString(enumerator.Current, entityMode));
} while (enumerator.MoveNext());
|
|
|
|
|
Hey guys,
I have an application which has hundreds of succesfull downloads a month using the ClickOnce technology.
I received an angry mail from a user who is unable to download the application.
I have copied the message he recieves at the bottom of this post. I don't understand why the download paths are all messed up during his download. Instead of searching for the files on our website the installation seems to be looking for the files locally.... Why is that? I repeat we have hundreds of users that are downloading with no problem. I started to think that maybe this was a competitor that was just trying to drive me insane!!!
PLATFORM VERSION INFO
Windows : 5.1.2600.131072
(Win32NT)
Common Language Runtime : 2.0.50727.42
System.Deployment.dll : 2.0.50727.42
(RTM.050727-4200)
mscorwks.dll : 2.0.50727.42
(RTM.050727-4200)
dfdll.dll : 2.0.50727.42
(RTM.050727-4200)
dfshim.dll : 2.0.50727.42
(RTM.050727-4200)
SOURCES
Deployment url :
file:///C:/Documents%20and%20Settings/Jon/Desktop/ExampleApplication.applicat
ion
IDENTITIES
Deployment Identity :
ExampleApplication.application, Version=2.1.3.7, Culture=neutral,
PublicKeyToken=3a0d09breeh853e7, processorArchitecture=msil
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are
listed later in the log.
* Activation of C:\Documents and
Settings\Jon\Desktop\ExampleApplication.application resulted in exception.
Following failure messages were detected:
+ Downloading file:///C:/Documents and
Settings/Jon/Desktop/ExampleApplication_2_1_3_7/ExampleApplication.exe.manifest
did not succeed.
+ Could not find a part of the path 'C:\Documents
and
Settings\Jon\Desktop\ExampleApplication_2_1_3_7\ExampleApplication.exe.manifest'
.
+ Could not find a part of the path 'C:\Documents
and
Settings\Jon\Desktop\ExampleApplication_2_1_3_7\ExampleApplication.exe.manifest'
.
+ Could not find a part of the path 'C:\Documents
and
Settings\Jon\Desktop\ExampleApplication_2_1_3_7\ExampleApplication.exe.manifest'
.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [12/4/2008 3:27:40 PM] : Activation of C:\Documents and
Settings\Jon\Desktop\ExampleApplication.application has started.
* [12/4/2008 3:27:41 PM] : Processing of deployment manifest has
successfully completed.
* [12/4/2008 3:27:41 PM] : Installation of the application has
started.
ERROR DETAILS
Following errors were detected during this operation.
* [12/4/2008 3:27:41 PM]
System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading file:///C:/Documents and
Settings/Jon/Desktop/ExampleApplication_2_1_3_7/ExampleApplication.exe.manifest
did not succeed.
- Source: System.Deployment
- Stack trace:
at
System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(Downloa
dQueueItem next)
at
System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at
System.Deployment.Application.FileDownloader.Download(SubscriptionState
subState)
at
System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri&
sourceUri, String targetPath, IDownloadNotification notification,
DownloadOptions options, ServerInformation& serverInformation)
at
System.Deployment.Application.DownloadManager.DownloadApplicationManifest(As
semblyManifest deploymentManifest, String targetDir, Uri deploymentUri,
IDownloadNotification notification, DownloadOptions options, Uri&
appSourceUri, String& appManifestPath)
at
System.Deployment.Application.ApplicationActivator.DownloadApplication(Subsc
riptionState subState, ActivationDescription actDesc, Int64 transactionId,
TempDirectory& downloadTemp)
at
System.Deployment.Application.ApplicationActivator.InstallApplication(Subscr
iptionState subState, ActivationDescription actDesc)
at
System.Deployment.Application.ApplicationActivator.PerformDeploymentActivati
on(Uri activationUri, Boolean isShortcut)
at
System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(
Object state)
--- Inner Exception ---
System.Net.WebException
- Could not find a part of the path 'C:\Documents
and
Settings\Jon\Desktop\ExampleApplication_2_1_3_7\ExampleApplication.exe.manifest'
.
- Source: System
- Stack trace:
at
System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
at
System.Net.FileWebRequest.GetResponse()
at
System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(Downloa
dQueueItem next)
--- Inner Exception ---
System.Net.WebException
- Could not find a part of the path 'C:\Documents
and
Settings\Jon\Desktop\ExampleApplication_2_1_3_7\ExampleApplication.exe.manifest'
.
- Source: System
- Stack trace:
at
System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess
access, Boolean asyncHint)
at
System.Net.FileWebRequest.WrappedGetResponseCallback(Object state)
--- Inner Exception ---
System.IO.DirectoryNotFoundException
- Could not find a part of the path 'C:\Documents
and
Settings\Jon\Desktop\ExampleApplication_2_1_3_7\ExampleApplication.exe.manifest'
.
- Source: mscorlib
- Stack trace:
at System.IO.__Error.WinIOError(Int32
errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String
path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights,
FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES
secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String
path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize,
Boolean useAsync)
at
System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode
mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
at
System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess
access, Boolean asyncHint)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
|
|
|
|
|
Did I post this in the correct forum? Does anybody have a clue?
|
|
|
|
|
(Yeah, this forum is good enough).
I've never seen it before, but my best guess is that the user is somehow downloading the .application file to his desktop rather than letting it be handled directly by the clickonce installer.
This could happen in several ways. If he's using firefox he'll need the firefox clickonce plugin to allow ff to correctly handle clickonce installs. Or the file types could be screwed up, causing IE/FF to incorrectly handle the file and download it rather than run it.
I'd go through the standard base of answers first. Clear the cache. Restart the browser, etc. If that doesn't fix it, try arranging to remote into his PC to watch him download it. See if he does anything stupid like right click->download rather than just running it. (You can use services like LogMeIn[^] or GoToMyPc[^] to do this.
Simon
|
|
|
|
|
I asked the user to set internet explorer as his default navigator instead of firefox and he was finally able to run it correctly.
There is something that I just don't understand though... I have tried reproducing the problem by installing firefox and setting it as the default browser and this doesn't happen to me. I don't have FFClickOnce installed there... So why does the error not occur?
Also, I have many users that use firefox and don't have the problem..
1. Why do some users with firefox encounter the problem and others don't???
2. Is there a complete recommended solution that is user-friendly?
3. Does upgrading to Visual Studio 2008 solve the problem? If it does do I have to upgrade to the .net framework 3.5 or can I use .net framework 2.0 with VS2008 to solve the problem?
|
|
|
|
|
1. Dunno. Different config maybe? Do you get many users with FF problems? Try to get sys info off of as many of them as you can and see if they all have a common factor, like maybe there is a clash with a plugin they are all using.
2. Dunno. Not until you figure out exactly what is causing the problem.
3. Very unlikely. VS 2008 / .net 3.5 still use the same CLR & clickonce framework. .net 3.0 & 3.5 is basically just a stack of extra libraries on top of .net 2.0. and vs2008 is just an updated GUI and new c# compiler. There is no change to the runtimes.
Simon
|
|
|
|
|
Ok i have a DataTable containing a number of rows. I have two DataViews from this dataTable, one shows all the rows with a few hidden columns including a descriptionField, sorted by a date field. The second shows any rows that have a descriptionFeild that contains data only.
The reason behind this is i'm producing a printable form that shows additional information if there is any on a seperate page to the rest of the data. Is there any easy way that i can get the index from one view to feedback into the dataset so it can be displayed by the second view.
e.g.
data set:
date code time description
21/11/08 DOC 00:12 document detailing house sale
22/11/08 LTO 00:06
22/11/08 LTI 00:06 responce to house sale document recieved
data view 1:
date code time
21/11/08 DOC 00:12
22/11/08 LTO 00:06
22/11/08 LTI 00:06
data view 2:
description
document detailing house sale
responce to house sale document recieved
what i need is data view 2 to either have a column with the index from its row in data view 1, or any other way of getting that index.
Hope i have explained this well enough, googling for other people with the same problem showed lots of badly written and confusing examples of the same problem and no useful answers.
|
|
|
|
|
|
Problem:
The question may be of basic nature but since I am new to MOSS, I am not able to acheive my objective.
I have a site in which I want to schedule an event using an Infopath(Office 2007) form. I am able to publish the form into my form library by checking the option 'To netwrok location'. My requirement is to create an entry in a Custom list when I submit this form. I have tried a number of options found in the Internet but am unable to do so.
Can someone please help me out in doing this?
|
|
|
|
|
Did I post it in the wrong forum?
|
|
|
|
|
Hi everyone,
I need help on two issue I faced during the making of my console program in .net(Any either C sharp or VB.NET).
(1)1st is that the console program I made doesn't have the basic contex menu like the cmd has one and pops up when we right click on anywhere on the black area.I want the same or something similar to that one.How should I proceed?
(2)2nd is when we launch a cmd program from cmd itself the program runs in the same window as of the cmd's own.Like if we run ping.exe then the cmd doesnt open a new window for it .Instead of that it simply runs the program in the same window.In my program I want to launch other console application(made by myself) but not in other window but the same of mine.How to do that?
Any help in C# or VB will be helpful.
Thanks in advance...
Dan
|
|
|
|
|
Dan Suthar wrote: console program I made doesn't have the basic contex menu
Console application takes input from the command line and while running it may receive input from Console class and produce output. However, console application does not have graphical user interface elements (neither does cmd, the menu comes from the window where cmd runs)
Dan Suthar wrote: In my program I want to launch other console application(made by myself) but not in other window but the same of mine
Didn't quite understand this. You can use Process class to start another process. If needed you can communicate with that process from your program even if the process doesn't have UI of any kind
|
|
|
|
|
Let me explain my problem.I have made one exe of console programs namely a.exe.Now when I run the a.exe by double clicking on it ,it opens a usual console window and runs further in it.Now the window that just opened doesn't have the contex menu.You may have seen the one in the orignal cmd.exe.I am NOT refering to that when we right click on titlebar but the one when we click on the black area in cmd.
Mika Wendelius wrote: neither does cmd, the menu comes from the window where cmd runs
So is there a way to bring that in mine a.exe program so that when I right click ,it popus up.The menu generally useful because it contains comands like paste and find etc.
And,
Mika Wendelius wrote: You can use Process class to start another process
So thanks for solving my second problem.
Thanks,
Dan
|
|
|
|
|
The only console windows that get the context menu you're talking about are the ones launched by CMD. This is a window that CMD wraps and adds the context menu and various other little tidbits.
Any process that is launched by doubling-clicking on it is not run under CMD, so you don't get the context menu or anything else you would normally find.
A console window has NOTHING to do with a "DOS" prompt. It's just a text window, kind of like a terminal emulator.
|
|
|
|
|
Ok, Now I am getting the matter.So only the cmd itself has the context menu !
Thankyou very much for sharing your knowledge
|
|
|
|
|
Thanks for replying to this. Didn't have the opportunity earlier. This was exactly the thing what I was trying to explain.
|
|
|
|
|
I m trying to open a zip file selected by user and extracting it....
It runs fine for the first time but when i again clicks on the open file button and selects a zip file. It throws an exception:
The process cannot access the file "file.png" because it is being used by another process
Note: file.png being one of the files extracted from the .zip file.
I think the FileStream object is not releasing the file after opening it. I tried using f.Destroy() and f.close() but they didnt work. Also the code runs for the first time successfully and it creates an error when another .zip file is opened (using the openfiledialog box) after opening the first file successfully.
String filename = openFileDialog1.FileName;
ZipInputStream zis = null;
FileStream f = new FileStream(filename, FileMode.Open);
zis = new ZipInputStream(f );
ZipEntry ze=null;
while ((ze = zis.GetNextEntry()) != null)
{
FileStream fs = null;
fs =System.IO.File.Create("d:\\puzzlesolver\\pieces\\"+ze.Name);
int size = 2048;
byte[] data = new byte[2048];
while (true)
{
size = zis.Read(data, 0, data.Length);
if (size > 0)
{
fs.Write(data, 0, size);
}
else
{
break;
}
}
fs.Close();
}
f.Close();
f.Dispose();
zis.Close();
zis.Dispose();
|
|
|
|
|
Hi,
this is the most likely explanation:
if you want write or delete access (anything other than read access) to a file
that just got created (by yourself or someone else, does not matter),
chances are you will find the file is being accessed by some other process,
and your access is not granted.
The other process very likely is some server code that is there to assist you
somehow. Candidates are:
- anti-virus software (Norton, McAfee, whatever)
- indexing software (Google Desktop, MS Office, whatever)
The common thing is these packages are looking all the time for new files, so
they can inspect them.
Microsoft is aware of the consequences; Windows Explorer will try rename and
delete attempts up to five times (with one-second interval), and only reports
failure if the action continues to fail for that time.
The solution:
1. either use a different file name
2. or remove all background reader candidates (bad idea)
3. or implement the retry loop as Explorer has it (use a Windows.Forms.Timer
for this)
BTW: if all you need is Read, make sure to allow others to read as well, i.e.
use File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read)
If you are convinced something else is going on, add try-catch (you should have done that straight away, every time and as soon as you do some I/O), display the entire exception text and the file name, note down the line numbers, tell your IDE to show line numbers, and publish all the details here.
locate the offending line.
|
|
|
|
|
Thank you so much... Your help made it work... i used
FileStream fs;
fs =System.IO.File.Create("d:\\puzzlesolver\\pieces\\"+ze.Name,2048,FileOptions.Asynchronous);
and write the stream on to this file....
|
|
|
|
|
Hello,
Im trying really hard to understand pointers, the good thing is that i understood the basics of pointers, the problem is that there is this question that confused me alot!
Here is the question:
Write and test a function that uses pointers to search for the address of an integer in a given array. If the integer is found, the function returns its address within the array; otherwise it returns NULL.
function to be used: int* search(int* p[], int n)
I tried to solve it but it keeps getting me confused more and more.
Am using Microsoft Visual Basic C++ (.NET).
Am really grateful for any kind of help possible.
Thank You.
|
|
|
|
|
Sorry, we don't do homework for you here.
Boo10 wrote: Am using Microsoft Visual Basic C++ (.NET)
I think this is your problem. What the hell is "visual basic c++ .net"? I think you may be slightly confused about what language you're using. (Check with your lecturer that you are using the same language as them. You will struggle to do this in the wrong language. As far as I'm aware, visual basic doesn't support pointers)
Break it down into steps. If you understand pointer basics like you say, each step should be fairly straight forward to write.
You need to write a function that take a pointer to an array of integers and an integer to search for. You need to loop through the array and check if any of the values it contains matches the integer you are searching for. When you find a match, you need to get a pointer to that value and return the pointer. If you don't find a match and get to the end of the array, you just return a null pointer.
Simon
|
|
|
|
|
Simon Stevens wrote: What the hell is "visual basic c++ .net"?
Nice catch. I wonder what the hell that was
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Boo10 wrote: Am using Microsoft Visual Basic C++ (.NET)
No such thing as Visual Basic C++. There is either Visual Basic or C++, make up your mind.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Attend an upcoming MSDN Developer Conference [^]and you will receive a Windows 7 Beta 1 DVD either at the event or mailed to you (depending on Windows 7 Beta release date).
Register today [^]and you’ll get the best of the PDC in your own backyard and hear all of the exciting announcements around the Azure Services Platform and Windows 7. The day-long conference is held in Houston TX, Orlando FL, Atlanta GA, Chicago IL, Minneapolis MN, Washington DC, New York NY, Boston MA, Detroit MI, Dallas TX, and San Francisco CA between December 9 and February 19.
- Experience Windows Azure. Create applications that seamlessly bridge the gaps between PC, Web, and phone
- Be among the first to see Windows 7. See the latest advances in Multi-Touch Application Development.
- Take your .NET skills to the next level. See sessions on WPF 4.0, Silverlight 2, The Future of C# and VB, ASP.NET 4.0, Live Mesh and more
Check out the sessions here[^]. Cost is $99.
|
|
|
|
|
Hi,
I wrote an application that able to connect another bluetooth device in .Net Framework 2.0 using bluetooth API, now I want to do this with .Net Compact Framework on my mobile device. That's the problem, When I'm Calling Bluetooth API like WSAStartup or using SizeOf method of Marshal class, it gives me NotSupportedException exception.
Please tell me how can i solve this problem.
Thank you.
DMASTER
|
|
|
|
|