提交 d02a4252 编写于 作者: L latkin

More places in IDE unit tests that need to use Assembly.EscapedCodeBase

上级 942d2924
......@@ -65,7 +65,7 @@ type GeneralTests() =
let publicTypesInAsm(asmfile : string) =
printfn "Validating assembly '%s'" asmfile
let codeBase = (new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath |> Path.GetDirectoryName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase)).LocalPath |> Path.GetDirectoryName
let asm = Assembly.LoadFrom(Path.Combine(codeBase, asmfile))
// For public types that have ComVisible, validate that the constructor is internal
......@@ -175,7 +175,7 @@ type GeneralTests() =
member public this.``PublicSurfaceArea.DotNetReflectionAndTypeProviders``() =
let tp = publicTypesInAsm @"FSharp.Data.TypeProviders.dll"
Assert.AreEqual(1, tp) // the 'DataProviders' type that is decorated with [<TypeProvider>] must be public\
let curDir = (new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath |> Path.GetDirectoryName
let curDir = (new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase)).LocalPath |> Path.GetDirectoryName
let script = """
open Microsoft.FSharp.Core.CompilerServices
......
......@@ -29,7 +29,7 @@ type MultiTargeting() =
member private this.prepTest(projFile) =
let dirName = Path.GetDirectoryName(projFile)
let libDirName = Directory.CreateDirectory(Path.Combine(dirName, "lib")).FullName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath |> Path.GetDirectoryName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase)).LocalPath |> Path.GetDirectoryName
let refLibPath = Path.Combine(libDirName, "FSharp.Core.Unittests.dll")
File.Copy(Path.Combine(codeBase, "FSharp.Core.Unittests.dll"), refLibPath)
File.AppendAllText(projFile, TheTests.FsprojTextWithProjectReferencesAndOtherFlags([], [refLibPath], [], null, "", "v2.0"))
......
......@@ -559,7 +559,7 @@ type References() =
DoWithTempFile "Test.fsproj"(fun projFile ->
let dirName = Path.GetDirectoryName(projFile)
let libDirName = Directory.CreateDirectory(Path.Combine(dirName, "lib")).FullName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath |> Path.GetDirectoryName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase)).LocalPath |> Path.GetDirectoryName
let refLibPath = Path.Combine(libDirName, "nunit.core.dll")
File.Copy(Path.Combine(codeBase, "nunit.core.dll"), refLibPath)
File.AppendAllText(projFile, TheTests.SimpleFsprojText([], [refLibPath], ""))
......@@ -574,7 +574,7 @@ type References() =
let l = new List<ReferenceContainerNode>()
project.FindNodesOfType(l)
l.[0]
let mscorlibPath = (new Uri("".GetType().Assembly.CodeBase)).LocalPath
let mscorlibPath = (new Uri("".GetType().Assembly.EscapedCodeBase)).LocalPath
let selectorData = new VSCOMPONENTSELECTORDATA(``type`` = VSCOMPONENTTYPE.VSCOMPONENTTYPE_ComPlus, bstrFile = mscorlibPath)
refContainer.AddReferenceFromSelectorData(selectorData) |> Assert.IsNotNull
let l = new List<AssemblyReferenceNode>()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册