Sharepoint 2010 Webpart debugging - Writing to the console

I am creating a SharePoint 2010 Webpart, and I'd like to write to the console for debugging purposes. Unfortunately the command Console.Writeline doesn't seem to work for me. How do I fix this??

Unfortunately, the functionality you're looking for doesn't exist.  Web parts are primarily used for web applications and are built within class libraries, which have no console functionality at all. Therefore, prevents writing to the console.
Alternatively, you can use Visual Studio to debug the web part and step through the code using breakpoints.  Visual Studio 2010 allows you to Debug the web part by hitting "F5".
Here's a link for some resources to help you get started developing web parts for SharePoint 2010.
http://donahoo-development.com

Similar Messages

  • When attempting to create an SSRS Report in SharePoint 2010 Dashboard Designer and change the Server Mode from Report Center to SharePoint Integrated

    Hi,
    When attempting to create an SSRS Report in SharePoint 2010 Dashboard Designer and change the Server Mode from Report Center to SharePoint Integrated, I get the following unhandled exception:
    ************** Exception Text **************
    System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: Instance validation error: '2' is not a valid value for Microsoft.PerformancePoint.Scorecards.SqlReportViewData.SqlReportViewDataServerMode.
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlReportViewData.Write1_SqlReportViewDataServerMode(SqlReportViewDataServerMode v)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlReportViewData.Write3_SqlReportViewData(String n, String ns, SqlReportViewData o, Boolean isNullable, Boolean needType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlReportViewData.Write4_SqlReportViewData(Object o)
       --- End of inner exception stack trace ---

    Hi,
    According to your post, an error occurred when you integrate SQL Server Reporting Services with SharePoint.
    1. Please check the steps as the link below:
    http://technet.microsoft.com/en-us/library/ff724283(v=office.14).aspx
    2. Try to clean the configuration cache on all of your SharePoint servers and re-tested.
    http://blogs.msdn.com/b/josrod/archive/2007/12/12/clear-the-sharepoint-configuration-cache-for-timer-job-and-psconfig-errors.aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Thread Process is exiting without completing the process in SharePoint 2010 webpart

    We have implemented simple thread to process to excel upload into SharePoint 2010 custom list.
    Thread process running in local SharePoint 2010 environment (OS -Windows 7). Once we deployed in SharePoint server,
    Thread process is exiting without completing its proces.
    Please let us know if you know any resolution.
    Code is as below
    Thread thread = new Thread(new ThreadStart(UploadData)); //Upload is the method where data will insert into List
    Thread.Start();
    Marulasiddappa SB (Swamy)

    Hi,
    According to your post, an error occurred when you used Thread in SharePoint 2010 web part.
    Please can do as follows:
    1. Execute the  UploadData method to see whether it can work.
    2. Debug your solution in Visual Studio to get more information the error,
    It will be easier for us to research if you can provide more code.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Performance Point Services in Sharepoint 2010 getting annotations out of the databasse

    Hi,
    I have a requirement to put in a Reporting Services Report the comments\ annotations from a PPS score card.
    I see the annotations table in the database, but don't see how to connect the GUIDS in the annotations table to the scorecard name. Is there information that can show me how to get this data?
    David Botzenhart

    try this one:
    http://sharepointsolutions.blogspot.com/2008/06/how-do-i-make-our-sharepoint-site-stop_17.html
    if fixed the issue fine other wise could you please check the ULS logs/ application ?IIS logs at the same time user kicked out.
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Sharepoint 2010 webpart connection issues

    I've had a number of people having issues starting the LiveCycle feature in sharepoint 2010 here is the workaround
    I had to do the following, download the powershell script located here https://skydrive.live.com/?cid=3d1aa7b9ba4b05fd&resid=3D1AA7B9BA4B05FD!234&id=3D1AA7B9BA4B 05FD%21234
    Go into powershell, that’s done by running powershell.exe just like you would a cmd prompt
    When at the powershell prompt issue the command Set-ExecutionPolicy AllSigned
    Issue a cd to go to the directory that contains the download script
    Then issue .\Set-RemoteAdministratorAccessDenied-False.ps1

    This is a known issue. See the blog http://blogs.adobe.com/livecycle/2012/05/access-denied-sharepoint.html

  • "Backing Up" Before Writing to the Console

    I am writing a program that uses the console for both input and output. Input comes from a seperate thread and could come at any time, even while the users is typing something.
    If this happens, then whatever is written to System.out gets tagged on to the end of what the user is typing, and the System.in input is moved to a new blank line where the user can continue typing.
    For example, say the users is trying to type the line "this is a test" and duirng that, the program outputs "HELLO USER". It would look like this:
    this iHELLO USER
    s a test
    Anyone who uses the console a lot will recognize what I'm talking about.
    Is there any way to fix this problem? For example, is there a way to make the console display "HELLO USER" on its own line and just move the input line down?
    I hope that question makes sense. I can explain it more if I need to. Thanks!
    Message was edited by:
    stephen.ware
    Message was edited by:
    stephen.ware

    There is no way to do it in cross-platform fashion. Just ignore it or think of using native code (ncurses library for linux, for example).

  • Sharepoint 2010 - Hiding 'Site Permissions' on the Site Actions toolbar for an entire site collection

    Good morning,
    I have been tasked with creating a feature that will allow a customer to hide the 'Site Permissions' menu option on the Site Actions toolbar.
    I was thinking this could be done easly with a site scoped feature with a feature.xml as follows
    and a manifest file like this
    I think what I have listed is an incorrect HideActionID but I am not finding the correct ID listed anywhere in the documentation.
    The other two custom actions that are in the manifest work perfectly and hide 'delete web' in site settings and add a new item to the site actions toolbar.
    Can you point me to the correct HideActionId for site permissions or tell me where to look.

    I will agree with Paul, but just in case if you dont change approach, below client side code may help.
    <script type="text/javascript">
    var doc = document.getElementsByTagName('ie:menuitem');
    for (var i = 0; i < doc.length; i++){
    itm = doc[i];
    if (itm.id.match('MenuItem_SitePermissions') != null){
    itm.hidden=true;
    break;
    </script>
    jQuery:
    $('ie\\:menuitem[id*=MenuItem_SitePermissions]').attr("hidden","true")
    Link: SharePoint 2010 Menu IDs
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Aperture writing to the console log

    The Console application receives a lot of messages from Aperture, whenever I am doing anything.
    The Console entry usually looks like (95%)
    +1/26/11 5:45:29 PM [0x0-0x495495].com.apple.Aperture[30958] Wed Jan 26 17:45:29 mymachine.local Aperture[30958] <Error>: CGBitmapContextGetBitsPerComponent: invalid context 0x13d5f68b0+
    or I intermittently receive (5%)
    +1/26/11 5:41:49 PM [0x0-0x495495].com.apple.Aperture[30958] This isn't a bitmap context. Forcing destination format to ARGB_8 for CGContext.+
    There can be anywhere from 8 to 20 entries per second. It makes trying to update faces slow to a crawl.
    I have Aperture 3.1.1.
    My Aperture library is on an internal soft RAID, composed of three disks (I left the primary disk as the OS/application disk).
    Any suggestions would be appreciated.
    Message was edited by: GateGuy

    Try System.out.println("\033[32mTest\033[0m"); If it works, google for Ansi control codes.

  • Retrieve data from AD from within a custom sharepoint 2010 webpart

    Hi,
    I have a requirement to retrieve user data from AD and display from within a custom built webpart.
    I am using the PrincipalContext class etc to get the info from AD, i have sucesfully done this in a console program without having to specifiy a username/password.
    In the webpart i have successfully retrieved the data by hard coding my domain username/password.
    Any ideas what i could do to get the webpart to retrieve information from AD without having to specify username/password?
    thanks cjm

    Hi C.J, 
    I wrote an example of this using credentials stored in the Secure Store in the TechNet Wiki. The article is here: http://social.technet.microsoft.com/wiki/contents/articles/20110.sharepoint-retrieving-credentials-from-the-secure-store-application-using-c.aspx
    There's an example in the above article about building a webpart that connects to AD using the credentials.
    Regards, Matthew
    MCPD | MCITP
    My Blog
    View
    Matthew Yarlett's profile
    See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
    Upload and Crop User Profile Photos

  • SharePoint 2010 webpart from word or pwr point. How to import or copy into SP 2010 (colored tile boxes with links)

    Dear SharePoint Forum,
    How do I import or create a colored tile screen from material created in Word or Pwr Point. The copy/Cut paste feature does now work..Is this custome HTML or J script or is there a special webpart for this type of SP 2010 work?
    Thanks,
    M. Breton (Misa)

    Dear SharePoint Forum,
    How do I import or create a colored tile screen from material created in Word or Pwr Point. The copy/Cut paste feature does now work..Is this custome HTML or J script or is there a special webpart for this type of SP 2010 work?
    Thanks,
    M. Breton (Misa)

  • SSRS 2012 with SharePoint 2010: Unable to connect to the remote server

    We had originally installed SSRS 2012 with SP 2010 and I did not like how the installation was configured, so we uninstalled everything and removed the SSRS server from the SharePoint farm and uninstalled all the SQL bits (SSRS was deployed to web tier in
    sharepoint mode).
    I've since added a new application server to host the SSRS SharePoint Mode and Installed the reporting services add-in on the WFE.   For reference, I have 1 WFE and 2 App Servers.  the WFE has the Reporting Service Add-in and both App Servers have
    the SharePoint mode of SSRS installed as described here: https://msdn.microsoft.com/en-us/library/hh479774(v=sql.110).aspx
    I've also installed the Service Application and all seems to work well up until I make an attempt to create a report or data source on the WFE.
    It looks like somewhere, the WFE is still looking to connect to the original SSRS machine we installed.  I've gone through registry, config files and the SharePoint config database to see if I can see where the reference value is.  Still can't
    find it anywhere.  None of the Reporting commandlets are helping.
    Technically what is occurring;
    Add Reporting service content types and create a New Reporting Data Source through UI
    ULS Logs go after the url: /_layouts/ReportServer/NewSharedDataSource.rsds
    Exception occurs after some time because it times out trying to connect to wrong host.  Exception below:
    Exception encountered for SOAP method GetSystemProperties: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <WRONG HOST IP>:80
    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) -
    -- End of inner exception stack trace ---
    at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.SetConnectionProtocol()
    at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.SoapMethodWrapper`1.ExecuteMethod(Boolean setConnectionProtocol)
    No powershell commands or any of the settings in the service application allow me to set this.  Any help would be appreciated.
    20 Bay Windows Home Server (Not Vail!)
    http://piroozjavan.blogspot.com/

    Issue an iisreset on the WFE, and validate that SSRS Service is running on the App servers.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • I cannot open files via firefox on sharepoint 2010, i can however open the files on IE.

    I cannot open files such as word, excel, pdfs on sharepoint when i use Sharepoint. I can open them ok on IE.
    i have updated the firefox to the latest version 8.
    Still no joy.
    Is there a add on i need to install?

    Looks like the site might make use of Adobe Flash. At this time we don't have support for the Android Adobe Flash plugin. We are working on getting Flash to work but it has been a difficult path as the Android Flash plugin is quite different from the desktop version.

  • Sharepoint 2010 appended port number in the public URL when redirect

    I'm new in sharepoint so please bear with me.
    We have a sharepoint deployment that has 4 WFEs, each WFE has 4 sites, all on a different port number.  For example;
    Site 1: http://site1.server1:11111
    Site 2: http://site1.server1:22222
    Site 3: http://site1.server1:33333
    Site 4: http://site1.server1:44444
    We have a load balancer that use a public URL to all these sites.  For example;
    Site 1: http://site1
    Site 2: http://site2
    Site 3: http://site3
    Site 4: http://site4
    Here is the problem.  Some of the link in the sharepoint site, when click, the URL is appended with the port number at the end of the public URL.  For example, http://site1:11111.
    I tried playing around with the AAM but it doesnt yield anything.  Any advise from the expert would be appreciated.

    Hi,
    Look at your default AAM.  This controls how the URL is appended or not.  You also need to look at the site bindings in IIS and make sure you have them for each site, for port 80.  And you need an alternate access mapping that routes site.server:Port
    to site if your desired outcome is to have any load balanced call route back to the default alternate access mapping of http://site1
    you would have a binding on http://site1 on port 80 in iis, and a host header associated with this site.
    Also, if you are using path based sites, this will only work for one site.  You can tell if you're using path based site collections if you see a / in front of their names inside view all site collections.
    Microsoft recommends using Host named site collections, check out this technet
    http://technet.microsoft.com/en-us/library/cc424952(v=office.15).aspx
    Stacy www.sharepointpapa.com

  • Sharepoint 2010 webpart database connectivity.

    Im developing a web part that allows users to create help-desk tickets. I'm developing using Visual studio 2012. Ive created some text boxes and drop down lists. I want to link my drop down lists to a database where the user can choose names from the database
    etc. Unlike a regular windows form app where you can choose data source for the DD list and configure SQL database, im only given the option to use XML data. How can I configure this to accept SQL databases??
    I have linked an SQL server(with databases) to my visual studio web part project. Just don't quite know how to link the data yet. Any help would be very well appreciated.

    I recommend you go over the 2 guides below, which will provide a better picture:
    How to connect to Data in Visual Studio
    MSDN: Binding Controls to Data in Visual Studio
    Hope it helps!
    Thanks, Ransher Singh, MCP, MCTS | Click Vote As Helpful if you think that post is helpful in responding your question click Mark As Answer, if you think that this is your answer for your question.

  • [HELP REQ] [DEPLOYMENT ERROR]Silverlight Sharepoint 2010 Webpart Applicaiton [ERROR WHEN I DEPLOY] [HELP REQ]

    **This solution contains no resources scoped for a web application and cannot be deployed to a particular web application.**
    That is the error I get when I try to deploy the site I get this error.  I have tried adding a element file but I am not too sure if I have done it correct.  Either way no matter what and how I try to add this to my server when I do the following
    commands it returns me this error.
    Commands
    Add the feature:
    Add-SPSolution c:\sp2010\srg.wsp
    Install:
    **Install-spsolution -identity srg.wsp -webapplication http://my.kpl.gov <http://my.kpl.gov/>  -gacdeployment** -THIS IS THE COMMANDS THAT CREATES THE ERROR-

    Hi PsychoticcWMU,
    Thank you for supporting MSDN forum.
    I would like to move this question to a more approximate forum for a better support.
    Thanks for your understanding.
    --James
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

Maybe you are looking for