VB.NET Queue constructor Error: Queue grow factor must be between 1 and 10 - vb.net

First some background:
VB.NET 2005 Application that accesses a MS-SQL back-end, using multiple Web Services for data gathering/publishing.
On to the error:
Our application mysteriously crashes on one of our clients computers, it works fine on the other computers in their office, but not on the big whigs' computer, which now makes it my problem. It appears to be a software conflict of some sort as they have replaced the computer (with the same software configuration I assume) but the error still persists. I'm currently waiting to hear back from their IT staff on whether there are any known differences between this user's setup and the others in that office.
What's even more annoying is the app just disappears. We can't easily debug it as no error messages are shown, even though we have specific code in there to catch unhandled exceptions and display a message, it just closes.
However, our exception handling code is being called (at least partially) because it successfully logs this following error (just does not show it to the user like other normal errors):
Error Message: Queue grow factor must be between 1 and 10.
Stack Trace: at
System.Collections.Queue..ctor(Int32 capacity, Single growFactor) at
System.Collections.Queue..ctor() at
System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous) at
System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args) at
System.Windows.Forms.Form.OnLoad(EventArgs e) at
System.Windows.Forms.Form.OnCreateControl() at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at
System.Windows.Forms.Control.CreateControl() at
System.Windows.Forms.Control.WmShowWindow(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Message& m) at
System.Windows.Forms.ContainerControl.WndProc(Message& m) at
System.Windows.Forms.Form.WmShowWindow(Message& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at
System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Now the really curious part is that we're not using Queues at all in the code that should be running at this point. (User opens app, tries to login, bam, error happens) The only Queues referenced anywhere in code is in a very specific function that is only ever run in a testing mode in-house. And it has no problems there whatsoever.
I'm kind of at a loss as to where to proceed with this problem, so any input would be appreciated.
Edit: Ok I've finally been in contact with their IT department, he was running .NET 2.0 as I suspected. I had the IT guy repair the .NET install from Add/Remove Programs and after that the problem no longer existed. So it was in fact a .NET issue

Is it possible that this user doesn't have the appropriate .net framework? I'm guessing your application requires 2.0, but maybe he/she has 3.5? Is he running a different version of windows than the other users?
The problem is not happening with your code but the lower level .net BCL.

I had a similar problem - I found this question posted looking for answers. In my case, I'd been working along fine, then updated to latest from my source code control, and after a build all of a sudden I'm seeing this problem at program startup time. Whaaa...?? How could System.Collections.Queue..ctor() suddenly be calling System.Collections.Queue..ctor(Int32, Single) where the 2nd arg wasn't between 1 and 10?
System.ArgumentOutOfRangeException was unhandled
Message="Queue grow factor must be between 1 and 10.\r\nParameter name: growFactor"
Source="mscorlib"
ParamName="growFactor"
StackTrace:
at System.Collections.Queue..ctor(Int32 capacity, Single growFactor)
at System.Collections.Queue..ctor()
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args)
at System.Windows.Forms.Control.BeginInvoke(Delegate method)
... my code below here ...
Reflector clearly shows this code:
public Queue() : this(0x20, 2f)
{
}
Turns out that prior to this code executing, I was P/Invoking to native code through a P/Invoke signature that did not match the native code (which had changed in SCM). (My build process did not properly copy the updated native DLL into the correct location.) So somehow the stack was corrupted at that point, leading to this unexplained badness.

That's one of the things I'm waiting to hear back from their IT staff about. Our app requires at least .NET 2.0, but I haven't personally done any testing with 3.5, I might have a chance to look into it later today..

Related

ImageResizer.ImageProcessingException?

Recently I noticed that one of the production site is throwing loads of the ImageResizer.ImageProcessingException errors. At the same time RAM consumption increases dramatically leading to app pool recycle.
ImageResizer.ImageProcessingException (0x80004005): Failed to acquire a lock on file "E:\wwwroot\imagecache\1e\d1a022809295f272d4dc7c63377a759c0f336be0a1be8ca696fcf27479892cf1.jpg" within 15000ms. Caching failed.
at ImageResizer.Plugins.DiskCache.DiskCache.Process(IResponseArgs e)
at ImageResizer.Plugins.DiskCache.DiskCache.Process(HttpContext context, IResponseArgs e)
at ImageResizer.InterceptModule.HandleRequest(HttpContext context, String virtualPath, NameValueCollection queryString, IVirtualFile vf)
at ImageResizer.InterceptModule.CheckRequest_PostAuthorizeRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
This is not a permanent issues. it does occur once or twice a day and lasts for 30-60 minutes. IIS restarts are not helping.... the rezizer is creating empty files (0 bytes). What is also interesting that the problem mostly occurs on 2 out of 3 web servers (it will start on one of them and the second will go tits up a few minutes later). The servers sort themselves out afer 45-90 minutes.
ImageResizer version: 3.4.2
What I tried:
- Upgrading to latest version
- Clearing image cache folder
- Enabling asyncwrties
Any idea what could be going on here?
Thanks,
M

Unhandle exception issue

We have a large app built using VB.NET VS2012. Every now and then when closing the app an unhandled exception occurs. Very random, sometimes it does it sometimes it doesn't.
The error is below.
System.InvalidOperationException was unhandled
HResult=-2146233079
Message=Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args)
at System.Windows.Forms.WindowsFormsSynchronizationContext.Post(SendOrPostCallback d, Object state)
at System.Windows.Forms.AxHost.ConnectionPointCookie.Finalize()
InnerException:
We produce a dump file to try and find where this is originating but have had no luck. The debugger just shows No source code available. We are using some third-party controls. At this point we just want to find what is trying to create the control. If its a problem with the third party control and if we don't have that code, we can't fix it but maybe we can work around it. But we can't find what is trying to create control (when shutting down).
We have reviewed many web posts describing how to utilize the crash dump files but have had no luck identifying the control (or even the control type) that is generating this.. Just knowing the type would help narrow it down.
Any ideas how we can at least get the type of control or the originating caller or?
If enough info isn't provided please let me know and I will post what I can.
Posting code is not an option because we have no idea where the message is coming from.
Thanks in advance!
I should have added that we do use try catch blocks for just about everything. We also do have a logging procedure but we arent seeing any of these exceptions in the log file.

Null Reference exception DNN Core 5.6.3

My site has been running fine for sometime now until recently I see in the event viewer a null reference exception in the DNN core:
DotNetNuke.Common.Globals.GetStatus() in
F:\Builds\Maintenance\WorkingDirectory\Library\Common\Globals.vb:line
1125 at DotNetNuke.Common.Initialize.InitializeApp(HttpApplication
app) in
F:\Builds\Maintenance\WorkingDirectory\Library\Common\Initialize.vb:line
138 at DotNetNuke.Common.Initialize.Init(HttpApplication app) in
F:\Builds\Maintenance\WorkingDirectory\Library\Common\Initialize.vb:line
228 at DotNetNuke.Common.Global.Global_BeginRequest(Object sender,
EventArgs e) at
System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)
the line 1125 is:
_Status = UpgradeStatus.None
Which is a property of the Globals class and an Enum
Also when this happens it doesnt just do it once then sort its self it does it roughly every minute for an hour or so.
I made sure all dataprovider.instances are either in a using or a try catch finally or self closing(if the reader is not used)
Any suggestion most welcome, as I'm officially lost.
Thanks
Similar to what ScottS mentioned, that line is setting a static enum value, so I don't see how a NullReferenceException could be thrown. Indeed, it could be a side-effect from something else.
That particular error is coming from Global.asax BeginRequest, which calls Initialize.Init(app). The only thing I can think of is to check your Http Modules. Both the RequestfilterModule and the UrlRewriteModule (which are default DNN http modules) also call Initialize.Init(app).
Perhaps check your web.config and IIS (particularly if you're running IIS 7) and make sure everything checks out?
had a look at the release.config and it have autoupdate=true set that to false and it hasnt been an issue since.

<nativehr>0x80070002</nativehr> in Sharepoint 2010

I recently upgraded from Sharepoint 2007 to 2010. I have a windows service that inserts pdfs into sharepoint. It works great on 2007. When I migrated to 2010, I started getting the following intermittent error:
<nativehr>0x80070002</nativehr>
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at
Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at Microsoft.SharePoint.SPWeb.GetList(String strUrl)
Here is the offending line of code:
SPList parentList = web.GetList(url);
What's weird, is that this only occasionally fails. I've actually wrapped this line of a loop, and if it it fails, I wait a bit, and then try to get the list again. Usually after a few tries, the GetList will succeed.
Since it's not easly duplicatable, I'm looking for any leads I might be able to track down.
From google searches, the "recommend" fix is to change any .GetList(...) calls to SPWeb.Lists[".."];
But, I got away from that, due to the perf hit on 2007 ( .GetList(...) has better perf than SPWeb.Lists["..."])
Any suggestions?
Thanks!
Dave
Maybe you could understand the error better if you first retrieved an SPFolder or SPFile related to the url in question. Check .GetFile(...).Exists and .GetFolder(...).Exists. You could also get the ParentList property hence.
SPWeb.GetList Method will certainly raise error if list is not there in the site. The method is designed like that. It is already documented in msdn.
If you are unsure that list is there or not; use Webobject.List[ListName] to avoid exception.
You can check my blog SharePoint Codes for sample code
I think this is late reply, but hope it helps others in future.
What resolved exact same error on SPWeb.GetList(reletiveUrl) with error thrown in method GetMetadataForUrl on SharePoint 2010:
restart IIS
restart SPTimerV4 (SharePoint 2010 Timer)
restart SPAdminV4 (SharePoint 2010 Administration)

FileInfo..ctor(string fileName) throwing exception: bug in SL 4.0 or .NET 4.0?

The following test case passes in .NET 4.0:
var fiT = new FileInfo("myhappyfilename");
Assert.IsNotNull(fiT);
... but fails in Silverlight 4.0 with the following error:
System.ArgumentNullException: Value cannot be null.
Parameter name: format
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at System.Environment.GetResourceString(String key, Object[] values)
at System.IO.FileSecurityState.EnsureState()
at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
at System.IO.FileInfo..ctor(String fileName)
Either the failure is a bug in SL 4.0, or the non-failure is a bug in .NET 4.0. Anyone know which it is?
(For the record, I'm running SL 4.0 on VS 2010 RC, which may be contributing to the problem).
See the MSDN documentation for FileInfo for Siverlight 4:
When it is called by an elevated-trust
application, provides instance methods
for the creation, copying, deletion,
moving, and opening of files, and aids
in the creation of FileStream objects.
This class cannot be inherited.
Chances are your application isn't running with elevated trust. If you want to access those restricted methods, it'll need to be.
As to why it's returning a null - that may well be a bug, possibly an improperly propagated SecurityException. Then again, it may be as designed - the docs are also still pre-release. EDIT: gabe's answer is most likely correct on this point.
Since you generally can't access the filesystem from Silverlight (you need a fully-trusted OOB app), it looks like SL4 is trying to throw an exception, but is failing because the text for that exception isn't available in the SL4 beta. Presumably you would get the correct exception once SL4 is released.