0

我对 VBasic 非常陌生,但我们开始了。我想在 VStudio 2010 环境中使用宏在我的解决方案中找到项目引用。该项目将用于添加新项目,将其路径用于新文件。

在我的解决方案中,使用了几个虚拟文件夹,当我尝试遍历所有树时,我未能深入到叶子。有人做过吗?

后来我尝试使用其名称收集项目参考:

StartupProj = DTE.Solution.Item("MySpecialProj.uniquext")

但我得到的只是这个错误

The parameter is incorrect. (Exception from HRESULT:0x80070057 (E:INVALIDARG))

谷歌搜索,发现它是正确的方法,但没有找到为什么我得到这个错误的运气。有人在这里帮我吗?

4

2 回答 2

1

Hope this helps:

Solution: Clear out the temporary framework files for your project in:

For Windows 7, the path is: C:\Users[username]\AppData\Local\Temp\Temporary ASP.NET Files\

For 64 bit systems with 'Framework' in the path the full path is: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\

Reference: http://www.solutioncottage.com/ShowSolution.aspx?solID=59

Note: doing a search on the error code on google normally yields some great results ;-)

Edit: Regarding googling the hexidecimal Error Code. I recommend its better to use the Microsoft Error Utility. You download the tool, put the exe in your system32 folder. Then open CMD and run the command err 0x80070057. It will tell you the error in the Operating System header files. Its much easiler to google these text messages along with the hex code. ps putting the exe in the system32 folder means you can run CMD from any directory in the command window.

Here is the result with the output ported to a text file: err 0x80070057 > C:\NotNullGothjik.txt

# for hex 0x80070057 / decimal -2147024809 :
  COR_E_ARGUMENT                                                corerror.h     
# MessageText: 
# An argument does not meet the contract of the method.
  DDERR_INVALIDPARAMS                                           ddraw.h        
  DIERR_INVALIDPARAM                                            dinput.h       
  DPERR_INVALIDPARAM                                            dplay.h        
  DPERR_INVALIDPARAMS                                           dplay.h        
  DPNERR_INVALIDPARAM                                           dplay8.h       
  DSERR_INVALIDPARAM                                            dsound.h       
  DVERR_INVALIDPARAM                                            dvoice.h       
  ecInvalidParam                                                ec.h           
  ecInvalidSession                                              ec.h           
  ecBadBuffer                                                   ec.h           
  MAPI_E_INVALID_PARAMETER                                      mapicode.h     
  STIERR_INVALID_PARAM                                          stierr.h       
  E_INVALIDARG                                                  winerror.h     
# One or more arguments are invalid
# 14 matches found for "0x80070057"
于 2012-07-03T20:09:34.910 回答
0

如果您想找出所有选定项目的 & DLL 引用,您可以使用:

Private _applicationObject As DTE2

Public Sub OnConnection(application As Object, connectMode As ext_ConnectMode, addInInst As Object, ByRef [custom] As Array)
    _applicationObject = DirectCast(application, DTE2)
End Sub

...

For Each project As Project In DirectCast(_applicationObject.ActiveSolutionProjects, Object())
    Dim vsProject As VSProject = TryCast(project.[Object], VSProject)
    If vsProject <> Nothing Then            
        For Each reference As Reference In vsProject.References
            ' Do cool stuff here
        Next
    End If
Next

您需要找到并包含对 VSLangProj.dll 的引用(例如在 Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies 中)

于 2012-07-04T05:39:10.243 回答