Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Macro to refresh solution explorer's folder

Macro to refresh solution explorer's folder

Scheduled Pinned Locked Moved C#
csharpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marco2250
    wrote on last edited by
    #1

    Hi all. Does anyone know how I can refresh a folder (like App_References) in solution explorer using a macro? This because I'd wrote a macro that refresh automatically all web references. But after this, the solution explorer don't show web service related files (.dico, .discomap, etc). The macro: [code] Option Explicit On Imports System Imports EnvDTE Imports EnvDTE80 Imports System.Diagnostics Imports System.IO Imports VSLangProj Imports System.net Public Module Macros Sub UpdateWebReferences() Dim vswebsite As VsWebSite.VSWebSite Dim vswebsiteRefs As New System.Collections.ArrayList For i As Integer = 1 To DTE.Solution.Projects.Count 'MsgBox(Microsoft.VisualBasic.Information.TypeName(DTE.Solution.Projects.Item(i).Object)) 'Change this with full web project path If "C:\Projetos\Internos\SmartSeguro\Code\Seguro.Web\" = DTE.Solution.Projects.Item(i).Name Then vswebsite = CType(DTE.Solution.Projects.Item(i).Object, VsWebSite.VSWebSite) 'vswebsite.p() For j As Integer = 1 To vswebsite.WebReferences.Count Dim webRef As VsWebSite.WebReference = vswebsite.WebReferences.Item(j) Dim wsPath As String = Path.GetDirectoryName(webRef.ProjectItem.FileNames(0)) Dim item As New WebServiceItem item.url = webRef.ServiceLocationUrl item.nNameSpace = webRef.Namespace item.dirPath = wsPath item.serviceName = webRef.ServiceName item.ReadWsdl() Dim fs As New FileStream(wsPath + "\" & webRef.ServiceName & ".disco", FileMode.Open) Dim teste() As Byte ReDim teste(fs.Length - 1) fs.Read(teste, 0, fs.Length) fs.Close() item.disco = New MemoryStream(teste) fs = New FileStream(wsPath + "\" & webRef.ServiceName & ".discomap", FileMode.Open) Dim teste2() As Byte ReDim teste2(fs.Length - 1) fs.Read(teste2, 0, fs.Length) fs.Close() item.discoMap = New MemoryStream(teste2) vswebsiteRefs.Add(item) webRef.Remove() Directory.Delete(wsPath) If vswebsite.WebReferences.Count = 0 Then Exit

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups