Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts

Thursday, 22 July 2021

Can Not publish aspx pages Visual Studio ( GatherAllFilesToPublish )

 

Visual Studio 2019
This week I had an issue with Visual Studio 2019 professional where my web project would not upload to the web sever. the error was to do with GatherAllFilesToPublish.

I did all the usual things and looked at all the solutions on  the web and came up blank for my problem. so I asked a colleague if he had seen this error before, he said uninstall all the versions you have on your machine ( I had 3) and reinstall. So reluctantly i went through the process of uninstalling each version i had.

I then did a reboot to get rid of all the rubbish and reinstall VS2019 , then came the setting up. That done i tried a tentative publish of the site and bingo all was now correct no error.


Happy coding


 

Monday, 22 January 2018

Detect a Mobile device in ASP.Net




Image result for mobile and pc



Spent some time the other day trying to sort out in AP.Net how to detect a Mobile as apposed to a desktop.
There where lots of code about that went about it a lot of different ways that I thought where a bit long winded then I saw this is my trawling and it works a treat.

 Dim mobile As Boolean
        With Request.Browser

            mobile = .IsMobileDevice

        End With


Mobile being true or false neat and simple.

Friday, 17 February 2017





Image result for visual studio logo





To open an excel file  in Visual studio use the following

Dim xlApp As New Excel.Application
        Dim xlBook As Excel.Workbook



        xlBook = xlApp.Workbooks.Open(path to the file)
        xlApp.Visible = True


Job done nice and simple  excel opens the file and closes the process when you close excel.

If you do GC.collect at the end it will do a garbage collection.

Wednesday, 8 May 2013

Send e-mail from Outlook from VB.NET

 To create an Outlook e-mail message in VB.net (2005)

Imports Microsoft.Office.Interop



  Dim OutlookMessage As Outlook.MailItem
        Dim AppOutlook As New Outlook.Application
        Try
            OutlookMessage = AppOutlook.CreateItem(Outlook.OlItemType.olMailItem)
            Dim Recipents As Outlook.Recipients = OutlookMessage.Recipients
            Recipents.Add("nick.gough@sprintcare.com")
            OutlookMessage.Subject = comid
            OutlookMessage.Body = "Testing outlook Mail"
            OutlookMessage.BodyFormat = Outlook.OlBodyFormat.olFormatHTML
            OutlookMessage.Attachments.Add(myfile)
'##use  this to ----- to Open the message for editing
            OutlookMessage.Display() 

or
            OutlookMessage.Send()
to send message
        Catch ex As Exception
            MessageBox.Show("Mail could not be sent") 'if you dont want this message, simply delete this line
        Finally
            OutlookMessage = Nothing
            AppOutlook = Nothing
        End Try

Multi Point USB Charger

  USB Plug Charger, 4-Port USB Fast Charger Plug with 33W Intelligent Quick Charge 3.0 Wall Charger, Multi USBPower Adapter UK Fast Charging...