.net - VB.NET Me.Close() Causing The Application To Throw A "has Stopped Working" Message?
Feb 16, 2011
I am not very experienced with VB.NET but I have to build an application using it in order to communicate with some software. Basically, I need to be able to call this exe and have it run to perform some tasks, then close itself down.I have the tasks running on page load but since I don't want the application to actually open, I use a Me.Close() to close it once it's finished the tasks. So, the whole thing works great (the tasks are even performed) except the Me.Close() causes a message to come up saying the application "has stopped working." Is it because I'm trying to close it while it's loading itself?Any suggestions on how to achieve this in a different way?I am forced to perform these tasks in VB, so please don't just say I should not be using VB.NET for this. I know I shouldn't be but I have to.
I recently updated my VS2010 website project from .NET 3.5 to 4.0. Everything was working fine in the website project. Today I decided to migrate the website to a web application project as I have learned this is the best way to work in .NET. I split out all my class files into a separate class library and copied all my other content into my new project. Then I updated all the references and web.config.
When I build the class library, everything works great. The problem is happening when I try to build/debug the web application project. It is acting like all the controls are missing and it is also throwing a bunch of compile errors about the public properties I have in my master pages.
Control errors: "The name 'INSERT CONTROL NAME HERE' does not exist in the current context"
Master page errors:'System.Web.UI.MasterPage' does not contain a definition....
It is giving these errors for every single control and master page property in my entire solution.I notice when I add a new web.form to this project, it also adds a filename.aspx.designer.cs file in addition to the .aspx and .aspx.cs file. My existing files do not have these extra files since they were created in a different .NET version.
UPDATE: It seems I was missing the step where I need to right click on the new application folder and select "Convert to web application". I just did that and it seems to be a little bit better...
Now it is choking on Literals that are inside single quotes:
am trying to fix an issue. I have an ASP.NET Ajax's TabContainer on the page. And each tab there is a gridview control that gets binded onload. However for some reason the browser gets closed automatically after the page renders. If I remove the TabContainer then it works fine. I think the binding code will no way effect the browser to close bacause no where in my code I am registering any Script block.Also one notable thing is this happens only in IE 8. It works fine in firefox and other browsers.I don't know if anyone encountered a similar issue before.
Until the Dec 29th my website was working fine. Then My fileupload problems started happening. My fileupload page would simply quit and say the page can not be found. I maximized all my timeout settings and that did not work. I called my hosting company and apparently they have no problem using my page to upload files from their geographical area. So then I concluded it might be a network problem. I ran a trace route and could not really figure out where the problem was. So, I have no idea what is going on. Is it possible that my site is being blocked by some black list out there somewhere?
Am in the middle of developing 2 projects and my AJAX Toolkit has stopped working, which is also stopping my designer filers being generated. Have the same problem in both projects. A sample error is below: Warning 3 Generation of designer file failed: Unable to create type 'cc1:CollapsiblePanelExtender'. Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
C:UsersHuwDocumentsMy Web SitesRegent2Regent2Master.Master 169 0 Regent2
I have a web app that allows users to upload images. Last week, all was well. This week, it appears the code is breaking. Here is the code:
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click If FileUploadControl.HasFile Then Dim month As String = ddlMonth5.SelectedValue Dim year As String = ddlYear7.SelectedValue ' Dim whatis As String = FileUploadControl.PostedFile.ContentType Try If (FileUploadControl.PostedFile.ContentType = "image/jpeg") Or (FileUploadControl.PostedFile.ContentType = "image/pjpeg") Or (FileUploadControl.PostedFile.ContentType = "image/gif") Or (FileUploadControl.PostedFile.ContentType = "image/x-png") Then Dim fs = New FileStream(FileUploadControl.PostedFile.FileName, FileMode.Open, FileAccess.Read) 'save file with new size Using image As System.Drawing.Image = System.Drawing.Image.FromStream(fs) Using bitmap As New Bitmap(image) bitmap.Save("C:WebsitesimagesCusRespData.jpg", image.RawFormat) bitmap.Save("C:Websitesimages" & month & year & "CusRespData.jpg", image.RawFormat) End Using End Using StatusLabel.Text = "Upload status: File uploaded!" fs.Close() fs = Nothing Else StatusLabel.Text = "Upload status: Only .jpg,.jpeg,.gif and .png files are accepted!" End If Catch ex As Exception StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " & ex.Message End Try StatusLabel.Visible = True End If End Sub
On the development side, I see this error: The file could not be uploaded. The following error occurred: Could not find a part of the path. On the production side, this occurs: The following error occured: A generic error occurred in GDI+.
I've just upgraded a visual studio.net 2003 project (asp.net 1.1) to visual studio.net 2010 (asp.net 4.0). I'm encountering a problem with viewing Crystal reports. I'm using Visual Studio Development Server as a Web Server.
When I try to create a new report (via code that worked fine previously) the line below causes the webserver40.exe to crash.
Protected WithEvents MyRep As New CrystalDecisions.CrystalReports.Engine.ReportDocument
I'm just getting started with MVC and I created a new MVC 2 C# project. Visual studio defaults it to .net 4 but since my hosting provider is still on 3.5 I went into properties and set my project to target .net 3.5. However when I did this a piece of my code stopped working.
I have an HttpHandler which takes care of 404 errors, which I implemented years ago as a way of doing url routing. If the request maps to a valid page, it redirects to that page. Otherwise, it returns a 404. (I know I should start using the new routing feature of asp.net 4.0, but that will take some time. I need to get this working asap.)
In IIS6, I have mapped the 404 error to "/404.ashx". In the web.config, custom errors are set up like so:
This has been working for years - it stopped working as soon as I changed the site to use asp.net 4.0. Everything was recompiled for 4.0, and there were no code changes.
Now, when I hit one of these urls that used to work, I get a blank page with a 404 error code. If I remove the IIS 404 error mapping, I get a regular old 404 page. It seems that the httphandler is not being called.
I have other http handler which are working fine. I figure there must be some configuration setting I missed or something like that. Naturally, this is a problem only on my production server, so I can't run it in the debugger to see what is happening.
I have some services deployed on [URL]I want to move them to [URL]. I have [URL] physically hosted & has its own web.config file. No inheritance issues...
I configured the subdomain (through my host--I don't actually own the web server) so that the subdomain is physically hosted & made sure it's running as an IIS application.
When the services lived on [URL], I used the following address prefixing in web.config:
[Code]....
Now that they're on [URL], I modified the web.config to read:
I'm having a problem with my 3rd cascading dropdown no longer displaying the list. I've obviously made a change somewhere but I cannot see it so I'm hoping some extra eyes will spot the problem. If it matters, I am using VWD 2010 Express, SQL Express, .NET 4.0I have checked the datasets and they are returning the proper list based on the input criteriahere is the pertinent code:
I have a c# control class inside of a dll, then this control is embedded in a web page in an asp.net application by using the object tag. When the dll is compiled with .net 3.5 sp1 and the web application also runs in .net 3.5 sp1, the code works fine. But when the dll is compiled in .net 4.0 and the web application runs in 4.0, the control does not show up in the web page. All I see is a box with an object icon in the upper left corner.
I have a .net 1.1 ASP application (domain.com) which has a .net 2 virtual directory (domain.com/v2) beneath it, both applications run within their own app pool on the same Windows Server 2003 machine running IIS 6. The web.config files for both apps are setup for Forms Authentication as described here - [URL]
Users would be directed to the domain.com/v2/login.aspx page which would authenticate for both applications, this configuration has been working fine for the last few years until installing one of the recent Windows 2003 security updates today. Now after authenticating under /v2 users keep getting redirected back to domain.com/v2/Login.aspx as domain.com doesnt see them as authenticated anymore.
which security update would have caused this and if its possible to fix or rollback?
I had the strangest bug yesterday while trying to debug in vs.net 2005....
I had an '05 web application. I clicked the "Run" button to start debugging, and the webpage popped up fine. I could run through the pages fine. Everything seemed fine....UNTIL!
Until I tried to start inserting breakpoints into my code. The application ignored them. In addition, I noticed my little green visual studio "Start Debugging" arrow (which is normally greyed out while in debug mode) was green. It was as if visual studio completely detached itself from my website I was trying to debug.
After playing around with it for a while, I realized I also had a vs.net 2008 solution open as well. My '08 solution wasn't in debug mode or anything, it was just sitting there open. I just happened to close it, not thinking anything of it, and presto! My 2005 debugger started working again!
So basically, I can't debug an '05 solution (or at least a web solution, as that's all I tried) while I also have an '08 solution open.
I have added autocompleteextender in page . It was working without parameters , when i have added parameters "pretext","count" it stops working. below are my code :
<div> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> <Services> <asp:ServiceReference Path="~/Admin/WebService1.asmx" /> </Services> </asp:ToolkitScriptManager> <asp:TextBox ID="TextboxCompletelist" runat="server"></asp:TextBox> <asp:AutoCompleteExtender ID="TextboxCompletelist_AutoCompleteExtender" runat="server" ServiceMethod="GetCompletionList" Enabled="True" ServicePath="~/Admin/WebService1.asmx" TargetControlID="TextboxCompletelist" CompletionSetCount="10"> </asp:AutoCompleteExtender> </div> namespace AgentService [WebService(Namespace = [URL] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class WebService1 : System.Web.Services.WebService { [WebMethod] public static string[] GetCompletionList(string PrefixText, int count) { string countryname; SqlParameter[] parm = new SqlParameter[1]; parm[0] = new SqlParameter("@PrefixText", PrefixText); DataTable dt = SqlHelper.ExecuteDataset(AppSetting.ActivateConnection, CommandType.StoredProcedure, "FetchAutoCompleteStates",parm).Tables[0]; List<string> items = new List<string>(); for (int i = 0; i <= dt.Rows.Count-1; i++) { countryname = dt.Rows[i]["statename"].ToString(); items.Add(countryname); } return items.ToArray(); }
Iam working on VWD express 2010, and things were going well, when the VWD crashed.I recovered my work and and realized that my controls stoped firing events.I removed and added button again, but in vain. I set "AutoEventWireup" and reset it also, but no use.I changed the code onto multiple systems. But the events wont fire. (I kept breakpoints also) My Web.config looks like this
I have been using a datagrid on various pages. For some reason it stopped working. When pressing the Edit to make a change to the record, the page posts back two times and the record does not go into the edit mode. I am using IE 7 for my browser. Below is my code.
I'm still building). After loggin in, users are presented with 3 radio buttons (they work), and 3 cascading drop downs (they work). Below that is an AJAX Accordion with 5 panes, each pane has a tabpanel with 4 tabs, 2 of the tabs have gridviews that change based on who is logged in and the radio buttons and dropdowns above