Search Results

Search found 1788 results on 72 pages for 'debugger'.

Page 39/72 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • Call up last exception on an ASP.NET error page.

    - by Aren B
    I've got an error page here SiteError.aspx and it's configured correctly in the web.config to go there when unhandled exceptions are encountered. I want to use this page to log the exception that triggered it as well because I only want to LOG the errors that the users encounter (i.e. if SiteError.aspx is ever hit.) This is the code I Have: In the OnLoad(...) in SiteError.aspx Exception lastEx = Context.Server.GetLastError(); if (lastEx != null) log.Error("A site error was encountered", lastEx); However, my log is never showing up in my Output, and If i breakpoint on line 2 (in this example) code execution is never interupted (after letting the exception clear to ASP.NET handling in the debugger.

    Read the article

  • Method chaining and exceptions in C#

    - by devoured elysium
    If I have a method chain like the following: var abc = new ABC(); abc.method1() .method2() .methodThrowsException() .method3() ; assuming I've defined method1(), method2() and method3() as public ABC method1() { return this; } and methodThrowsException() as public ABC method3() { throw new ArgumentException(); } When running the code, is it possible to know which specific line of code has thrown the Exception, or will it just consider all the method chaining as just one line? I've done a simple test and it seems it considers them all as just one line but Method Chaining says Putting methods on separate lines also makes debugging easier as error messages and debugger control is usually on a line by line basis. Am I missing something, or does that just not apply to C#? Thanks

    Read the article

  • NSNumber floatValue not equal to NSNumber value

    - by Mirkules
    Hi Everyone, First post here. Having a problem with NSNumber's floatValue method -- somehow, it returns an imprecise number. Here's the problem: I store a bunch of NSNumbers in an array, like this: NSArray *a = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.04f], [NSNumber numberWithFloat:0.028f], [NSNumber numberWithFloat:0.016f], [NSNumber numberWithFloat:0.004f], nil]; Then I try to retrieve the first value (for example): NSNumber n = (NSNumber) [a objectAtIndex:0]; CGFloat f = [n floatValue]; In the debugger, n shows a value of 0.04 (in the summary column), but f shows a value of 0.0399999991. What am I doing wrong here? Thanks everyone.

    Read the article

  • CheckboxList not setting Selected with Viewstate disabled

    - by Earlz
    I have a CheckboxList that seems to load and do everything right, except for when I do a postback, it will not have the Item.Selected property set. I have viewstate disabled for the entire page. I load it like so(inside Page_Load on every load): foreach (DataRow service in d.Tables[0].Rows) { cblServices.Items.Add(new ListItem((string)service["description"], service["id"].ToString())); } My markup is simple: <asp:CheckBoxList runat="server" ID="cblServices" Width="300px"></asp:CheckBoxList> and then, I use basically something like this(in a _Click serverside event for a button) foreach(ListItem item in cblServices.Items){ if(item.Selected){ MyLabel.Text+="selected: "+item.Value+item.Text; } } and MyLabel never has any text added to it. I can verify with the debugger that it does reach the _Click's foreach loop, but no item is ever selected. What could be the cause of this?

    Read the article

  • Select only items in a specific DIV using HtmlAgilityPack

    - by Adam Haile
    I'm trying to use the HtmlAgilityPack to pull all of the links from a page that are contained within a div declared as <div class='content'> However, when I use the code below I simply get ALL links on the entire page. This doesn't really make sense to me since I am calling SelectNodes from the sub-node I selected earlier (which when viewed in the debugger only shows the HTML from that specific div). So, it's like it's going back to the very root node every time I call SelectNodes. The code I use is below: HtmlWeb hw = new HtmlWeb(); HtmlDocument doc = hw.Load(@"http://example.com"); HtmlNode node = doc.DocumentNode.SelectSingleNode("//div[@class='content']"); foreach(HtmlNode link in node.SelectNodes("//a[@href]")) { Console.WriteLine(link.Value); } Is this the expected behavior? And if so, how do I get it to do what I'm expecting?

    Read the article

  • Debugging feature activation in SharePoint 2007

    - by Eric U.
    I have a SharePoint feature that is activated under 'Site Collection Features' that is having some issues being activated. I've activated it through the stsadm as well as the SharePoint UI, both unsuccessful. The feature toggles from deactivated to activated, but the result that should be there is not. The result is some pages that should be created. So my question is does anyone know of a way to step through the activation of features process? I'd like to be able to attach Visual Studio 2008 to the browser and step through a few breakpoints that I've set. I've narrowed the error down to the FeatureReceiver's FeatureActivated(SPFeatureReceivrProperties properties) Pages that I've been referencing: http://msdn.microsoft.com/en-us/library/ee231550.aspx http://blogs.msdn.com/b/sharepoint/archive/2007/04/10/debugger-feature-for-sharepoint.aspx

    Read the article

  • Determining full XHR request URL on a Google Chrome XHR Breakpoint

    - by DanH
    I am initiating a jQuery ajax ($.ajax) post, within the Google Chrome browser. I have setup a XHR breakpoint in the "XHR Breakpoints" section of the "Scripts" tab within the Developer Tools. The criteria of the breakpoint is "get" ie. I want the debugger to break on all XHR requests which contain the word "get" in them (somePage.asmx/getListOfAnimals) is an example. The breakpoint is being correctly hit, however I am unable to determine what the exact URL that is being requested. I realize I can remove the breakpoint and see what URL is being requested from the "Network" tab, but I want to know this at the time the breakpoint is hit. I have tried stepping through the XHR request once it has been hit in Chrome, but I must be missing a Javascript object/property which contains the fully requested URL. Google Chrome has detected that the XHR requested URL contains "get" but how do I get to this URL from within the debug session before the request is made?

    Read the article

  • FileNotFound Exception when using TestDriven.NET and NUnit

    - by Quang Anh
    I'm Writing a simple pong game in C# and XNA 4.0 to learn unit testing. The tools used are TestDriven.NET and NUnit, all newest versions. The problem is, if I test the code with VS2010 internal debugger, everything runs fine, but when I use "Run Test(s)" from menu, the application chokes with error: Test 'WindowsGame1.Game1.TestGameMenu' failed: Microsoft.Xna.Framework.Content.ContentLoadException : Error loading "SpaceBackground". File not found. ----> System.IO.FileNotFoundException : Error loading "Content\SpaceBackground.xnb". File not found. (some more below...) So it stops when the first textre is going to be loaded. What's going on? If you want to check the code out, download it here http://www.mediafire.com/?qwnkmyqheum

    Read the article

  • Strange Exception on getGeneratedKeys() with JDBC for MySQL 5.1

    - by sweeney
    Hello, I'm using JDBC to insert a row into a MYSQL database. I build a parameterized command, execute it and attempt to retrieve the auto generated keys as follows: String sql = "INSERT IGNORE INTO `users` (`email`, `pass-hash`) VALUES (?, ?)"; Connection conn = SQLAccess.getConnection(); PreparedStatement ps = conn.prepareStatement(sql); ps.setString(1, login); ps.setString(2, passHash); int count = ps.executeUpdate(); if (count == 1) { ResultSet rs = ps.getGeneratedKeys(); rs.next(); //some more stuff... } For some reason, I get the following SQLException on the line containing ResultSet rs = ps.getGeneratedKeys();: !Statement.Generated Keys Not Requested! Any thoughts? When I run the same query, as generated by running the app through the debugger, in a MySQL browser it executes without incident. Thanks, brian

    Read the article

  • c# HTTPListener encoding issue

    - by Rob Griffin
    I have a Java application sending HTTP requests to a C# application. The C# app uses HTTPListener to listen for requests and respond. On the Java side I'm encoding the URL using UTF-8. When I send a \ character it gets encoded as %5C as expected but on the C# side it becomes a / character. The encoding for the request object is Windows-1252 which I think may be causing the problem. How do I set the default encoding to UTF-8? Currently I'm doing this to convert the encoding: foreach (string key in request.QueryString.Keys) { if (key != null) { byte[] sourceBytes =request.ContentEncoding.GetBytes(request.QueryString[key]); string value = Encoding.UTF8.GetString(sourceBytes)); } } This handles the non ASCII characters I'm also sending but doesn't fix the slash problem. Examining request.QueryString[key] in the debugger shows that the / is already there.

    Read the article

  • Mutating the expression tree of a predicate to target another type

    - by Jon
    Intro In the application I 'm currently working on, there are two kinds of each business object: the "ActiveRecord" type, and the "DataContract" type. So for example, we have: namespace ActiveRecord { class Widget { public int Id { get; set; } } } namespace DataContracts { class Widget { public int Id { get; set; } } } The database access layer takes care of "translating" between hierarchies: you can tell it to update a DataContracts.Widget, and it will magically create an ActiveRecord.Widget with the same property values and save that. The problem I have surfaced when attempting to refactor this database access layer. The Problem I want to add methods like the following to the database access layer: // Widget is DataContract.Widget interface DbAccessLayer { IEnumerable<Widget> GetMany(Expression<Func<Widget, bool>> predicate); } The above is a simple general-use "get" method with custom predicate. The only point of interest is that I 'm not passing in an anonymous function but rather an expression tree. This is done because inside DbAccessLayer we have to query ActiveRecord.Widget efficiently (LINQ to SQL) and not have the database return all ActiveRecord.Widget instances and then filter the enumerable collection. We need to pass in an expression tree, so we ask for one as the parameter for GetMany. The snag: the parameter we have needs to be magically transformed from an Expression<Func<DataContract.Widget, bool>> to an Expression<Func<ActiveRecord.Widget, bool>>. This is where I haven't managed to pull it off... Attempted Solution What we 'd like to do inside GetMany is: IEnumerable<DataContract.Widget> GetMany( Expression<Func<DataContract.Widget, bool>> predicate) { var lambda = Expression.Lambda<Func<ActiveRecord.Widget, bool>>( predicate.Body, predicate.Parameters); // use lambda to query ActiveRecord.Widget and return some value } This won't work because in a typical scenario, for example if: predicate == w => w.Id == 0; ...the expression tree contains a MemberAccessExpression instance which has a MemberInfo property (named Member) that point to members of DataContract.Widget. There are also ParameterExpression instances both in the expression tree and in its parameter expression collection (predicate.Parameters); After searching a bit, I found System.Linq.Expressions.ExpressionVisitor (its source can be found here in the context of a how-to, very helpful) which is a convenient way to modify an expression tree. Armed with this, I implemented a visitor. This simple visitor only takes care of changing the types in member access and parameter expressions. It may not be complete, but it's fine for the expression w => w.Id == 0. internal class Visitor : ExpressionVisitor { private readonly Func<Type, Type> dataContractToActiveRecordTypeConverter; public Visitor(Func<Type, Type> dataContractToActiveRecordTypeConverter) { this.dataContractToActiveRecordTypeConverter = dataContractToActiveRecordTypeConverter; } protected override Expression VisitMember(MemberExpression node) { var dataContractType = node.Member.ReflectedType; var activeRecordType = this.dataContractToActiveRecordTypeConverter(dataContractType); var converted = Expression.MakeMemberAccess( base.Visit(node.Expression), activeRecordType.GetProperty(node.Member.Name)); return converted; } protected override Expression VisitParameter(ParameterExpression node) { var dataContractType = node.Type; var activeRecordType = this.dataContractToActiveRecordTypeConverter(dataContractType); return Expression.Parameter(activeRecordType, node.Name); } } With this visitor, GetMany becomes: IEnumerable<DataContract.Widget> GetMany( Expression<Func<DataContract.Widget, bool>> predicate) { var visitor = new Visitor(...); var lambda = Expression.Lambda<Func<ActiveRecord.Widget, bool>>( visitor.Visit(predicate.Body), predicate.Parameters.Select(p => visitor.Visit(p)); var widgets = ActiveRecord.Widget.Repository().Where(lambda); // This is just for reference, see below Expression<Func<ActiveRecord.Widget, bool>> referenceLambda = w => w.Id == 0; // Here we 'd convert the widgets to instances of DataContract.Widget and // return them -- this has nothing to do with the question though. } Results The good news is that lambda is constructed just fine. The bad news is that it isn't working; it's blowing up on me when I try to use it (the exception messages are really not helpful at all). I have examined the lambda my code produces and a hardcoded lambda with the same expression; they look exactly the same. I spent hours in the debugger trying to find some difference, but I can't. When predicate is w => w.Id == 0, lambda looks exactly like referenceLambda. But the latter works with e.g. IQueryable<T>.Where, while the former does not (I have tried this in the immediate window of the debugger). I should also mention that when predicate is w => true, it all works just fine. Therefore I am assuming that I 'm not doing enough work in Visitor, but I can't find any more leads to follow on. Can someone point me in the right direction? Thanks in advance for your help!

    Read the article

  • Objective C Insanity -- simple assignement to a single float variable results in {{{CRAZY}}} values

    - by morgancodes
    memberA is defined in the header of ClassA. memberB is defined in the header of ClassB. ClassB is a subclass of ClassA Inside an instance of ClassB, setting memberA via simple assignment: memberA = 0.05 ...also changes memberB, but to a crazy number -- 1028443341. Additionally, assigning 0.05 to memberA results in memberA showing up in the debugger as 5.33083531e-38. Both variables are floats, neither is a pointer. I'm almost certianly making some noob mistake, but I don't have any clue what it might be. What sort of screw-up might make it so assigning a value to one variable results in crazy values appearing in two variables? I can give more details or real code, but figured I'd keep it simple to start with in case it's an obvious problem/solution.

    Read the article

  • ResolveURL not resolving in a user control

    - by WebJunk
    I'm trying to use ResolveUrl() to set some paths in the code behind of a custom ASP.NET user control. The user control contains a navigation menu. I'm loading it on a page that's loading a master page. When I call ResolveUrl("~") in my user control it returns "~" instead of the root of the site. When I call it in a page I get the root path as expected. I've stepped through with the debugger and confirmed, ResolveUrl("~") returns "~" in my user control code behind. Is there some other way I should be calling the function in my user control code behind to get the root path of the site?

    Read the article

  • Android: "Edit Source Lookup Path...".

    - by user307480
    I am developing on a Mac with Eclipse and have the skeleton for an app that implements the standard framework callbacks (onCreate, onDestroy, onPause, etc..). When I set breakpoints in the callbacks the debugger stops and displays a tab that says "ActivityThread.performLaunchActivity(ActivityThread $ActivityRecord,Intent)line:2477" and in the tab page body there is some red text that says "Source not found" and a button that says "Edit Source Lookup Path...". I have tried adding several paths via "Edit Source Lookup Path..." but can't see to find the one Eclipse is looking for. Can anyone point me in the right direction?

    Read the article

  • Android application chrashes after "share" intent

    - by Johe Green
    Hi, My app offers a "share/tell-a-friend" function. When the "share" button is pressed the following method is being called to open a list of apps, which can perform the action (Eg. Gmail, Twittroid, Facebook...): public void share() { Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getText(R.string.menu_share_subject)); shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, getText(R.string.menu_share_body)); startActivity(Intent.createChooser(shareIntent, getText(R.string.menu_share_intent))); } The sharing functionality works basically. But when the sharing app (Facebook, Twitter, ...) tries to return to my app, a force close is thrown. I guess that my app gets closed in the background during the sharing process... at least that is what the debugger sais... Any ideas?

    Read the article

  • Can I get the stack traces of all threads in my c# app?

    - by Drew Shafer
    I'm debugging an apparent concurrency issue in a largish app that I hack on at work. The bug in question only manifests on certain lower-performance machines after running for many (12+) hours, and I have never reproduced it in the debugger. Because of this, my debugging tools are basically limited to analyzing log files. C# makes it easy to get the stack trace of the thread throwing the exception, but I'd like to additionally get the stack traces of every other thread currently executing in my AppDomain at the time the exception was thrown. Is this possible?

    Read the article

  • Memory problem with basic UITableView when scrolling

    - by Sheehan Alam
    I have a very simple UITableView that has 3 sections, and 3 rows per section. #pragma mark - #pragma mark UITableView delegate methods - (NSInteger)tableView:(UITableView *)tblView numberOfRowsInSection:(NSInteger)section { return 3; } - (UITableViewCell *)tableView:(UITableView *)tblView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tblView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell... return cell; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tblView { if (tblView == self.tableView) { return 3; } else { return 1; } } Everything shows up fine, but as soon as I scroll my application crashes and my debugger tells me: * -[ProfileViewController tableView:cellForRowAtIndexPath:]: message sent to deallocated instance 0x5ae61b0 I'm not exactly sure what I am doing wrong.

    Read the article

  • Launching my deployed my app gets "has stopped working" error. How do I debug this?

    - by Brad Mathews
    I deployed a VB.Net app and ran it and I get 'AppName has stopped working" "Windows is checking for a solution to the problem" along with a Cancel button under Windows 7. Under XP I am only getting the option to Send the error report to Microsoft or not. There is no apparent way to hook into a debugger. I am not getting any exception data. I have put msgboxes at the very start of my code and they are not hit so it is failing before any of my code is even executing. I have checked all dependencies that I can think of. I developed the app on VS2008 Windows 7 and deploying to Windows 7 and WinXP. I need some advice - how do I debug this? Thanks, Brad

    Read the article

  • How do I shim a Excel automation addin that implements IDTExtensibility2 but is not a com add in?

    - by Shane
    I found this article http://blogs.officezealot.com/whitechapel/archive/2005/05/21/4728.aspx but the example given is a straight automation add-in that does not implement IDTExtensibility2. My add in implements IDTExtensibility2 to get access to the excel object model but is not installed as a COM add in so RegisterFunction for example will called when one of the add in functions is first used not when the excel starts as in the case of the a COM add in. Will this method described in the link above work in my case also? I tried version 2.3.1 of the shim wizard which seems to have support for automations add-ins (it has a check box for automation add ins in the metadata import process). The generated shim runs (I can see breakpoints being hit in the debugger), but my functions no longer work (i get #NAME). The shims is installed as a COM add in and loads when excel starts so I suspect it's not doing what I want.

    Read the article

  • Unkillable console windows

    - by rep_movsd
    I'm developing an OpenGL based 2d simulation with GLUT under Visual C++ 2008, sometimes when I have an assert() or unhandled exception and break into the debugger, the GLUT display window closes, but the console window remains open.They just cant be killed!!! They do not show up with Task manager, Process Explorer or any other tool, I cannot find the window handle using the Spy++ tool either. Worst thing is they prevent my system (Windows XP) from shutting down, I have to manually poweroff (and of course I have to run chkdsk on my drives and invariably it finds and fixes minor errors after bad shutdowns) Has anyone come across such an issue?

    Read the article

  • Is there any way to set or code breakpoints conditionally?

    - by froadie
    I've been wondering this for a while - is there a way to code/program breakpoints...? Conditionally? For example, can I specify something like - "when this variable becomes this value, break and open the debugger"? (Would be quite useful, especially in long loops when you want to debug loop execution of a late loop value.) I suppose this may be IDE-specific since debugging is implemented differently in different IDEs... I'd be interested to know how to do this in any IDE, but specifically in Eclipse and Visual Studio.

    Read the article

  • question about c# asp.net

    - by daddyCool
    in order to use the FolderBrowserDialog control in asp.net, i had to add a reference to System.Windows.Forms in my project. i wrote this code: FolderBrowserDialog f = new FolderBrowserDialog(); f.ShowDialog(); but this error occured: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process. any help?

    Read the article

  • Inspect in memory hsqldb while debugging

    - by Albert
    We're using hdsqldb in memory to run junit tests which operate against a database. The db is setup before running each test via a spring configuration. All works fine. Now when a tests fails it can be convinient to be able to inspect the values in the in memory database. Is this possible? If so how? Our url is: jdbc.url=jdbc:hsqldb:mem:testdb;sql.enforce_strict_size=true The database is destroyed after each tests. But when the debugger is running the database should also still be alive. I've tried connecting with the sqldb databaseManager. That works, but I don't see any tables or data. Any help is highly appreciated!

    Read the article

  • When debugging on WinCE, how can I set Visual Studio to always load symbol files it knows about?

    - by tsellon
    I'm debugging a WinCE, C++ program in Visual Studio across an ActiveSync connection. Every time I start the process it fails to load symbol information. However, if I right click on the module and hit 'Load Symbols' it correctly locates the symbol information without any further prompting from me. Is there a way that I can set Visual Studio to either: (a) automatically load this symbol information, or (b) automatically break the process into the debugger once it's loaded (similar to what windbg does)? I'm guessing there's a setting somewhere, but I've yet to find it. Update: I forgot to mention in the original question that I'm not debugging with the instance of Visual Studio that created the exe.

    Read the article

  • DragDrop registration did not succeed in Setup Project

    - by rodnower
    Hello, we have some installation project in Visual Studio solution (Other project types - Setup and deployment - Setup project). This project have other library type project with Installation class named InstallationCore like project output. In user action I call to Install and Uninstall functions of installer of InstallationCore. InstallationCore has windows forms for interaction with user. There, in forms, I use Drag and Drop functionality for Drag and Drop text from Tree View to Text Box. But in line: txbUserName.AllowDrop = true; I get error of JIT debugger: Unhandled exception has occured DragDrop registration did not succeed System.InvalidOperationException: DragDrop registration did not succeed And long stack trace after that. Important to say, that when I run Installer function from test project the error did not occur and all work fine. Error occurs only when I run the .msi package. Any suggestions? Thank you for ahead.

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >