PowerShell v2로이 간단한 .NET 4 함수를 호출하려고합니다. 정의는 다음과 같습니다.PowerShell은 ASP.NET DLL에서 간단한 함수를 호출하지 못합니다.
Public Shared Function currentSchoolYear() As String Member of NM4.SiteAdmin.Logic.Subscription
해당 기능을 포함하는 DLL 파일에 경로를 추가합시다. 웹 응용 프로그램 DLL 파일 ASP.NET MVC입니다.
PS > Add-Type -Path C:\xxx\bin\xxxWebApp.dll
의 그것을 시도하자 (FAIL를!) :
PS >
[NM4.SiteAdmin.Logic.Subscription]
IsPublic IsSerial Name
BaseType
-------- -------- ---- -------- True False Subscription
System.Object
이의이
PS >
[NM4.SiteAdmin.Logic.Subscription]::currentSchoolYear
MemberType : Method
OverloadDefinitions : {static string
currentSchoolYear()} TypeNameOfValue
:
System.Management.Automation.PSMethod
Value : static string
currentSchoolYear() Name
: currentSchoolYear IsInstance
: True
왜 PowerShell을
에서 기능을 관찰하자PS >
[NM4.SiteAdmin.Logic.Subscription]::currentSchoolYear()
Exception calling "currentSchoolYear"
with "0" argument(s): "The type
initializer for
'NM4.SiteAdmin.Logic.Subscription'
threw an exception." At line:1 char:54
+ [NM4.SiteAdmin.Logic.Subscription]::currentSchoolYear
<<<<()
+ CategoryInfo : NotSpecified: (:) [],
MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
하는의 PowerShell을에서 클래스를 관찰하자 왜 오? 그것은 나에게 의사처럼 보인다.
cd C : \ xxx \ bin \ 시도했지만 같은 오류가 발생합니다. – Malartre
powershell을 사용하여 오류에 대한 자세한 정보를 얻을 수 있습니까? – Malartre
OK 자세한 내용은 다음과 같습니다. $ error | 형식 목록 - 강제 – Malartre