Search Results

Search found 10355 results on 415 pages for 'shell extension'.

Page 31/415 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • ASP.NET Error Handling: Creating an extension method to send error email

    - by Jalpesh P. Vadgama
    Error handling in asp.net required to handle any kind of error occurred. We all are using that in one or another scenario. But some errors are there which will occur in some specific scenario in production environment in this case We can’t show our programming errors to the End user. So we are going to put a error page over there or whatever best suited as per our requirement. But as a programmer we should know that error so we can track the scenario and we can solve that error or can handle error. In this kind of situation an Error Email comes handy. Whenever any occurs in system it will going to send error in our email. Here I am going to write a extension method which will send errors in email. From asp.net 3.5 or higher version of .NET framework  its provides a unique way to extend your classes. Here you can fine more information about extension method. So lets create extension method via implementing a static class like following. I am going to use same code for sending email via my Gmail account from here. Following is code for that. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Net.Mail; namespace Experiement { public static class MyExtension { public static void SendErrorEmail(this Exception ex) { MailMessage mailMessage = new MailMessage(new MailAddress("[email protected]") , new MailAddress("[email protected]")); mailMessage.Subject = "Exception Occured in your site"; mailMessage.IsBodyHtml = true; System.Text.StringBuilder errorMessage = new System.Text.StringBuilder(); errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}<BR/>","Exception",ex.Message)); errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}<BR/>", "Stack Trace", ex.StackTrace)); if (ex.InnerException != null) { errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}<BR/>", " Inner Exception", ex.InnerException.Message)); errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}<BR/>", "Inner Stack Trace", ex.InnerException.StackTrace)); } mailMessage.Body = errorMessage.ToString(); System.Net.NetworkCredential networkCredentials = new System.Net.NetworkCredential("[email protected]", "password"); SmtpClient smtpClient = new SmtpClient(); smtpClient.EnableSsl = true; smtpClient.UseDefaultCredentials = false; smtpClient.Credentials = networkCredentials; smtpClient.Host = "smtp.gmail.com"; smtpClient.Port = 587; smtpClient.Send(mailMessage); } } } After creating an extension method let us that extension method to handle error like following in page load event of page. using System; namespace Experiement { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender,System.EventArgs e) { try { throw new Exception("My custom Exception"); } catch (Exception ex) { ex.SendErrorEmail(); Response.Write(ex.Message); } } } } Now in above code I have generated custom exception for example but in production It can be any Exception. And you can see I have use ex.SendErrorEmail() function in catch block to send email. That’s it.. Now it will throw exception and you will email in your email box like below.   That’s its. It’s so simple…Stay tuned for more.. Happy programming.. Technorati Tags: Exception,Extension Mehtod,Error Handling,ASP.NET

    Read the article

  • In-Proc SxS opens for shell extension in managed code?

    - by Jens Granlund
    The recommendation used to be "Do not write in-process shell extensions in managed code." But with .NET Framework 4 and In-Process Side-by-Side the main reason not to write shell extensions in managed code should be resolved. With that said, I have three questions. Is it now okay to write shell extensions in managed code? Which problems, if any might there be with writing shell extensions in managed code? What reasons might there be to write shell extensions in unmanaged code?

    Read the article

  • How to grab data from webpage in Chrome and output into Chrome extension popup?

    - by chimerical
    For a Google Chrome extension, none of the Javascript I write to manipulate the DOM of the extension popup.html seems to have any effect on the popup's DOM. I can manipulate the DOM of the current webpage in the browser just fine by using content_script.js, and I'm interested in grabbing data from the webpage and outputting it into the extension popup, like so (below: popup.html): <div id="extensionpopupcontent">Links</div> <a onclick="click()">Some Link</a> <script type="text/javascript"> function click() { chrome.tabs.executeScript(null, {file: "content_script.js"}); document.getElementById("extensionpopupcontent").innerHTML = variableDefinedInContentScript; window.close(); } </script> I tried using chrome.extension.sendRequest from the documentation at http://code.google.com/chrome/extensions/messaging.html, but I'm not sure how to properly use it in my case, specifically the greeting and the response. contentscript.js ================ chrome.extension.sendRequest({greeting: "hello"}, function(response) { console.log(response.farewell); });

    Read the article

  • Extension Methods in Dot Net 2.0

    - by Tom Hines
    Not that anyone would still need this, but in case you have a situation where the code MUST be .NET 2.0 compliant and you want to use a cool feature like Extension methods, there is a way.  I saw this article when looking for ways to create extension methods in C++, C# and VB:  http://msdn.microsoft.com/en-us/magazine/cc163317.aspx The author shows a simple  way to declare/define the ExtensionAttribute so it's available to 2.0 .NET code. Please read the article to learn about the when and why and use the content below to learn HOW. In the next post, I'll demonstrate cross-language calling of extension methods. Here is a version of it in C# First, here's the project showing there's no VOODOO included: using System; namespace System.Runtime.CompilerServices {    [       AttributeUsage(          AttributeTargets.Assembly          | AttributeTargets.Class          | AttributeTargets.Method,       AllowMultiple = false, Inherited = false)    ]    class ExtensionAttribute : Attribute{} } namespace TestTwoDotExtensions {    public static class Program    {       public static void DoThingCS(this string str)       {          Console.WriteLine("2.0\t{0:G}\t2.0", str);       }       static void Main(string[] args)       {          "asdf".DoThingCS();       }    } }   Here is the C++ version: // TestTwoDotExtensions_CPP.h #pragma once using namespace System; namespace System {        namespace Runtime {               namespace CompilerServices {               [                      AttributeUsage(                            AttributeTargets::Assembly                             | AttributeTargets::Class                            | AttributeTargets::Method,                      AllowMultiple = false, Inherited = false)               ]               public ref class ExtensionAttribute : Attribute{};               }        } } using namespace System::Runtime::CompilerServices; namespace TestTwoDotExtensions_CPP { public ref class CTestTwoDotExtensions_CPP {    public:            [ExtensionAttribute] // or [Extension]            static void DoThingCPP(String^ str)    {       Console::WriteLine("2.0\t{0:G}\t2.0", str);    } }; }

    Read the article

  • Web Essentials extension now available for Visual Studio Express

    - by ihaynes
    Originally posted on: http://geekswithblogs.net/ihaynes/archive/2014/08/12/web-essentials-extension-now-available-for-visual-studio-express.aspxVisual Studio Express has always had one big issue for me, the inability to install any (or very few) of the normal Visual Studio extensions. One of the best extensions for front-end development and design is the Web Essentials extension by Mads Kristensen on the VS team. It was a hugely welcome surprise to find that this extension is now available, in full, for VS Express, and had been since May, darn it! It has a huge number of useful features, not least being able to minify HTML, CSS and JavaScript files, which is almost a prerequisite for responsive sites. It can also bundle them together. There are lots of other features for HTML editing; intellisense and syntax highlighting for robots.txt files; 'surround with tag', intellisense for meta tags (including iOS, Twitter and Facebook); generate vendor-specific CSS etc etc. The full details can be found at the dedicated site. http://vswebessentials.com This extension alone makes VS Express far more useful and worth having.

    Read the article

  • Stream.CopyTo() extension method

    - by DigiMortal
    In one of my applications I needed copy data from one stream to another. After playing with streams a little bit I wrote CopyTo() extension method to Stream class you can use to copy the contents of current stream to target stream. Here is my extension method. It is my working draft and it is possible that there must be some more checks before we can say this extension method is ready to be part of some API or class library. public static void CopyTo(this Stream fromStream, Stream toStream) {     if (fromStream == null)         throw new ArgumentNullException("fromStream");     if (toStream == null)         throw new ArgumentNullException("toStream");       var bytes = new byte[8092];     int dataRead;     while ((dataRead = fromStream.Read(bytes, 0, bytes.Length)) > 0)         toStream.Write(bytes, 0, dataRead); } And here is example how to use this extension method. using(var stream = response.GetResponseStream()) using(var ms = new MemoryStream()) {     stream.CopyTo(ms);       // Do something with copied data } I am using this code to copy data from HTTP response stream to memory stream because I have to use serializer that needs more than response stream is able to offer.

    Read the article

  • New Visual Studio 2010 Extension - Collapse Solution

    - by MikeParks
    If your team has recently upgraded to Visual Studio 2010, take a second to check out the new Extension Manager. You can use it to browse through or install tons of tools, controls, or templates from the Visual Studio Gallery. My friend, Cory Cissell, and I recently teamed up and created an extension of our own called "Collapse Solution". It adds an option called Collapse Solution to the context menu of the solution node in the solution explorer. It also adds an option called Collapse Project to the context menu of each project node in the solution explorer. When that option is clicked, it will walk through the solution explorer tree and collapse any expanded child nodes in that section (projects, folders, code behind files, designer files, etc.). I use to have an add-in that did this in Visual Studio 2008 but it wasn't compatible when we upgraded to 2010 so we decided to write our own. The old tool was also packaged with a bunch of other junk that we didn't need so we figured it would be a much cleaner tool if it was broken off into its own extension. There's no need to install extra tools if you don't really need them. So if you have upgraded to Visual Studio 2010, please feel free to try out our Collapse Solution extension and leave us a rating/review in the Visual Studio Gallery. Thanks! Here's the link: http://visualstudiogallery.msdn.microsoft.com/en-us/2d81fec6-71f3-4fa5-87b4-c2aa18e42f92

    Read the article

  • Pointer position way off in Java Application menu's when using gnome-shell

    - by Hailwood
    When using any java application in gnome-shell if the window is maximised the pointer position is way off; but only on the menu's, in the editor, or the side panel, the pointer is fine. This only presents itself when the window is maximized, and it seems that the further away from 0x0 the window is when you maximise it, the bigger the pointer offset. From what I have gathered it has to do with the window not updating it's size when it gets maximised. The other issue is that when a gnome-shell notification appears, when clicking on it, I lose the ability to type in the editor, I can select text etc, but can't give it focus to type. I must bring up some other text input (e.g. right click on a file on the left, select rename, which brings up a rename dialog) after that I can type in the editor again. So, how can I fix this? Below is as much information as I can think to provide $ gnome-shell --version GNOME Shell 3.6.1 $ java -version java version "1.7.0_09" Java(TM) SE Runtime Environment (build 1.7.0_09-b05) Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode) $ file /etc/alternatives/java /etc/alternatives/javac /etc/alternatives/java: symbolic link to '/usr/lib/jvm/java-7-oracle/jre/bin/java' /etc/alternatives/javac: symbolic link to '/usr/lib/jvm/java-7-oracle/bin/javac'

    Read the article

  • GlassFish Extension for Oracle JDeveloper

    - by Shay Shmeltzer
    We just release a new version of Oracle JDeveloper - 11.1.2.3. One new feature here is built-in support for GlassFish. This include the ability to create an "application server" connection to GlassFish and then deploy to that server with one click from inside JDeveloper. You can use this for deploying Oracle ADF Essentials application on Glassfish, but you can also use it to deploy any Java EE application you build in JDeveloper on GlassFish. However, if you are planning to work with GlassFish and JDeveloper on a more regular basis as your development server, then you might find my new extension useful. The new extension allows you to start and stop an external GlassFish instance, as well as start it in debug mode (which will allow JDeveloper to remotely debug your application as it runs on the server. I also added a button that will invoke the web admin console of Glassfish. Here is a quick demo that will show you how to work with the extension: The extension is available from help->check for updates, or you can download it directly from here, and then use help->check for updates pointing to the local zip file.

    Read the article

  • Is it possible to use two different shells for different terminal windows?

    - by NES
    Is it possible to use another shell for scripts than for standard terminal use? The problem is, i use fish as shell at the moment and i find i very convenient. But i would like to learn a bit of shell programming in Ubuntu. Since there are differences between those two it would be nice, to work with fish and bash at the same time, perhaps in different terminal windows? i know i can write a shell script and have to put the interpreter in the beginning. But for testing developing at commandline i would find it useful to fast switch between shells or use two different terminal windows with different shells in one session at the same time?

    Read the article

  • Cannot install shell-themes using gnome-tweak-tool

    - by Chris
    How do I fix this? I will attempt to upload a screenshot of the problem. Notice there is an error like triangle near the shell themes and nothing is select-able. Also there are no shell extensions under the shell extensions tab. I have come across many postings on how to fix this but none worked for me. I currently have 12.04 LTS. I have a custom Phenom quad core machine with Radeon HD 5770 graphics if that helps.

    Read the article

  • Cross-Browser Extension Installation now Possible with Opera and Google Chrome

    - by Akemi Iwaya
    People have been curious if there would be cross-browser compatibility for extensions due to Opera’s recent switch to the browser engine that Google Chrome uses. That question has now been answered. The OMG! Chrome! Blog has put together a nice tutorial on how to get cross-browser extension compatibility set up and working with your browser of choice. Screenshot courtesy of OMG! Chrome! Blog. While it is not surprising that the first steps in cross-browser extension compatibility have been taken, it will be interesting to see how it develops as the process is refined and further development occurs with the ‘new’ Opera. What are your thoughts on this? Is cross-browser extension compatibility really that important? Perhaps you feel that it does not matter? Let us know your thoughts in the comments!    

    Read the article

  • How to use Mercurial's LargeFiles extension? [migrated]

    - by DuncanBoehle
    I use Mercurial for game development, and I'm trying to use the LargeFiles extension included in Mercurial 2.0 to keep track of large binary assets. Unfortunately there isn't a whole lot of documentation on the extension, so I'm not sure how people are expected to use it. For example, is there any way to safely clean out the .hg/largefiles directory? If I'm on the tip revision, and expect to always have internet access, then I don't need the old versions of largefiles cluttering up the repository, since that's the whole point of using the LargeFiles extension. Also, how do I have more fine-grained control over where the largefile store is? I can only assume that it's created somewhere on the computer that ran hg init, but I have no idea about the details. Thanks!

    Read the article

  • Managed code and the Shell – Do?

    Back in 2006 I wrote a blog post titled: Managed code and the Shell – Don't!. Please visit that post to see why that advice was given.The crux of the issue has been addressed in the latest CLR via In-Process Side-by-Side Execution. In addition to the MSDN documentation I just linked, there is also an MSDN article on the topic: In-Process Side-by-Side.Now, even though the major technical impediment seems to be removed, I don’t know if Microsoft is now officially supporting managed extensions to the shell. Either way, I noticed a CodePlex project that is marching ahead to enable exactly that: Managed Mini Shell Extension Framework. Not much activity there, but maybe it will grow once .NET 4 is released... Comments about this post welcome at the original blog.

    Read the article

  • Extension Manager in Visual Studio 2010

    One of the powerful aspect of Visual Studio is its ability to be extended and many people do that. You can find numerous extensions at the Visual Studio Gallery. The VSX team links to a 4-part blog series on how to create and share templates. You can also look find extension examples on the vsx code gallery.With Visual Studio 2010, you can search for items and install them directly from within Visual Studio's new Extension Manager. You launch it from the Tools menu:When the dialog comes up, be sure to explore the various actionable areas on the left and also note the search on the right. For example, I typed "MP" and it quickly filtered the list to show me the MPI Project Template:Others have written about this before me, just bing Extension Manager (and note that Beta2 introduced changes, some of which you can witness in the screenshot above). Comments about this post welcome at the original blog.

    Read the article

  • Preview YouTube Videos On Mouse Over–Chrome Extension

    - by Gopinath
    YouTube video preview is a nice Google Chrome extension that let you preview YouTube videos without playing them. After installing the plugin, users can hover mouse on any of the YouTube video thumbnails displayed on YouTube website to preview the video. This plugin tries to imitate the beautiful Bing Video search results preview feature by displaying 3 frames of video. The plugin does not work outside YouTube website. May be you can give a try to this plugin.  Download YouTube Video Preview Extension This article titled,Preview YouTube Videos On Mouse Over–Chrome Extension, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Extension Manager in Visual Studio 2010

    One of the powerful aspect of Visual Studio is its ability to be extended and many people do that. You can find numerous extensions at the Visual Studio Gallery. The VSX team links to a 4-part blog series on how to create and share templates. You can also look find extension examples on the vsx code gallery.With Visual Studio 2010, you can search for items and install them directly from within Visual Studio's new Extension Manager. You launch it from the Tools menu:When the dialog comes up, be sure to explore the various actionable areas on the left and also note the search on the right. For example, I typed "MP" and it quickly filtered the list to show me the MPI Project Template:Others have written about this before me, just bing Extension Manager (and note that Beta2 introduced changes, some of which you can witness in the screenshot above). Comments about this post welcome at the original blog.

    Read the article

  • Une extension pour bloquer Google Analytics signée Google fonctionne avec Chrome, Firefox et Interne

    Une extension pour bloquer Google Analytics Signée Google fonctionne avec Chrome, Firefox et Internet Explorer : initiative sincère ou marketing ? Qui l'eut cru ? Google a imaginé une extension qui permet de bloquer Google Analytics, un de ses services d'analyse d'audiences proposés aux webmestres. Google Analytics se présente sous la forme d'un code JavaScript à insérer dans une page web et permet de collecter des informations sur les visiteurs? notamment sur la manière dont ils sont arrivés sur le site. Baptisée Analytics Opt-out Browser Add-on, l'extension permet de ne pas envoyer ces informations au propriétaire du site ? ni a priori à Goog...

    Read the article

  • How to remove Recent Item boorkmark from Gnome shell standard "save windows"

    - by Kiwy
    I search all around the internet till the 6th page of result on google with very precise search, but I can't figure how I can do that. I'm working with last updated ubuntu 12.04 and gnome shell, and I wonder how I can REMOVE and I say remove not clear or avoid feeding but remove completly the "recent item" bookmark you can see in the standard save windows of gnome shell here's a picture (in french it's "Récemment utilisés"): Sorry not enought point to post image to see what I talk about, just do that: -open gedit -type anything -save your file -Now that windows got a "recent item" and I want it DOWN I cannot reward point, but I would if I could for the guy finding a solution, and a bonus point if you find a way to remove it every where it appears in gnome shell. Thank you for time. Antoine

    Read the article

  • How do I get to the maintenace shell?

    - by Narida
    I'm asking this because initially, my problem was this (power failure during installation, so I typed the following instructions in the maintenance shell: sudo mount -o remount,rw / sudo dpkg --configure a sudo mount -o remount,ro / sudo sync sudo reboot The first three lines worked, afterwards, my computer (a Dell Inspiron 530) got stalled for several hours, so I unplugged it. When I turned it on, the log in screen appeared, and after I try to write my password, it leads me back to the log screen. I must note that when I typed the first three lines during the maintenance shell mode, it said that the errors which were encountered during processing were: initscripts bluez gnome-bluetooth So, what do I have to do in order to get back to the maintenance shell so I can type code again? And, what code do I have to write in order to restore my computer? Thank you for your attention.

    Read the article

  • Ubuntu 12.10 and Gnome-Shell : can't see nor launch apps except with Alt + F2

    - by Ratoune2008
    I've installed Ubuntu 12.10 and Gnome-Shell 3.6. Everything worked fine till the moment I've began to customize the main menu (apps wich appears in Dash and so on). I don't know wether I've done something wrong or if there is a bug : suddenly, the Dash became empty. My favourite docks too, except the "Show apps" button. When I activate it, there is only an empty dash, no apps showed. The only way I can access an app is using the "Alt+F2" shortcut. I've tried to restart gnome-shell (Alt-F2 / r) but nothing has changed... A logout and a reboot have not changed ... Do you know how to repair the gnome-shell ? Thanks for your help...

    Read the article

  • Spaces in type attribute for Behavior Extension Configuration Issues

    - by Shawn Cicoria
    If you’ve deployed your WCF Behavior Extension, and you get a Configuration Error, it might just be you’re lacking a space between your “Type” name and the “Assembly” name. You'll get the following error message: Verify that the extension is registered in the extension collection at system.serviceModel/extensions/behaviorExtensions So, if you’ve entered as below without <system.serviceModel> <extensions> <behaviorExtensions> <add name="appFabricE2E" type="Fabrikam.Services.AppFabricE2EBehaviorElement,Fabrikam.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/> </behaviorExtensions> </extensions> The following will work – notice the additional space between the Type name and the Assembly name: <system.serviceModel> <extensions> <behaviorExtensions> <add name="appFabricE2E" type="Fabrikam.Services.AppFabricE2EBehaviorElement,Fabrikam.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/> </behaviorExtensions> </extensions>

    Read the article

  • Visual Studio 2010: Extension Manager

    - by Natasa Gavrilovic
    If you still didn’t explore Extension Manager under Tools in Visual Studio 2010 now it’s the time!   VS2010 can be expended to include add-ons you wish to have. The Extension Manager list is pretty extensive, where most of them are ‘still work in progress’ tools but, at least, it is worth trying.   Listed below are top ranked ones that should help to enhance your coding experience:   ·         Productivity Power Tools – set of small gadgets: Auto Brace Completion, Quick Access, Column Guides, Align Assignments, Triple Click etc. ·         PowerCommands  ·         Visual Studio Web Standards Update –newly released update for support HTML5 and CSS3 ·         MVC Scaffolding - scaffold elements from entities ·         NuGet Package Manager – automated package manager tool   Online the Extension manager is locaated ats Visual Studio Gallery.   Another good place is CodePlex. It is open source software website focusing on .NET that contains more than 20 000 add-ons tagged in more than 20 different categories.   Feel free to add a comment how your VS is ‘customized’ and what will be your recommendation.   N.

    Read the article

  • When running a shell script, how can you protect it from overwriting or truncating files?

    - by Joseph Garvin
    If while an application is running one of the shared libraries it uses is written to or truncated, then the application will crash. Moving the file or removing it wholesale with 'rm' will not cause a crash, because the OS (Solaris in this case but I assume this is true on Linux and other *nix as well) is smart enough to not delete the inode associated with the file while any process has it open. I have a shell script that performs installation of shared libraries. Sometimes, it may be used to reinstall versions of shared libraries that were already installed, without an uninstall first. Because applications may be using the already installed shared libraries, it's important the the script is smart enough to rm the files or move them out of the way (e.g. to a 'deleted' folder that cron could empty at a time when we know no applications will be running) before installing the new ones so that they're not overwritten or truncated. Unfortunately, recently an application crashed just after an install. Coincidence? It's difficult to tell. The real solution here is to switch over to a more robust installation method than an old gigantic shell script, but it'd be nice to have some extra protection until the switch is made. Is there any way to wrap a shell script to protect it from overwriting or truncating files (and ideally failing loudly), but still allowing them to be moved or rm'd? Standard UNIX file permissions won't do the trick because you can't distinguish moving/removing from overwriting/truncating. Aliases could work but I'm not sure what entirety of commands need to be aliased. I imagine something like truss/strace except before each action it checks against a filter whether to actually do it. I don't need a perfect solution that would work even against an intentionally malicious script. Ideas I have so far: Alias cp to GNU cp (not the default since I'm on Solaris) and use the --remove-destination option. Alias install to GNU install and use the --backup option. It might be smart enough to move the existing file to the backup file name rather than making a copy, thus preserving the inode. "set noclobber" in ~/.bashrc so that I/O redirection won't overwrite files

    Read the article

  • Can I remove the ctrl-z key binding in my shell?

    - by Nagel
    The background for this question: I currently have to do a lot of my work in terminal over ssh, and I use screen quite a bit. Because I found the ctrl-a key binding for screen commands so annoying since I'm accustomed to using ctrl-a to go to the beginning of a line, I changed it to ctrl-z. The only problem with this is that when I'm in Matlab, think I am in Screen but am not, pressing ctrl-z will instantly kill my Matlab session, because ctrl-z is the key binding for suspending processes in *nix. So the question is: can I remove the key binding for ctrl-z in my shell so that it does no longer suspend a process? My shell is terminal.app on OSX.

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >