Browse Source

Fix designer errors and .NET Framework on Unix errors.

test-meta-packages
Jeremy Koritzinsky 8 years ago
parent
commit
05e0020f53
  1. 1
      src/Avalonia.DesktopRuntime/Avalonia.DesktopRuntime.csproj
  2. 2
      src/tools/Avalonia.Designer.HostApp/Avalonia.Designer.HostApp.csproj
  3. 10
      src/tools/Avalonia.Designer.HostApp/Program.cs
  4. 3
      tests/Avalonia.DesignerSupport.Tests/DesignerSupportTests.cs

1
src/Avalonia.DesktopRuntime/Avalonia.DesktopRuntime.csproj

@ -16,5 +16,6 @@
</ItemGroup> </ItemGroup>
<Import Project="..\..\build\NetCore.props" /> <Import Project="..\..\build\NetCore.props" />
<Import Project="..\..\build\NetFX.props" />
<Import Project="..\Shared\PlatformSupport\PlatformSupport.projitems" /> <Import Project="..\Shared\PlatformSupport\PlatformSupport.projitems" />
</Project> </Project>

2
src/tools/Avalonia.Designer.HostApp/Avalonia.Designer.HostApp.csproj

@ -18,4 +18,6 @@
<ProjectReference Include="..\..\Avalonia.Styling\Avalonia.Styling.csproj" /> <ProjectReference Include="..\..\Avalonia.Styling\Avalonia.Styling.csproj" />
<ProjectReference Include="..\..\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj" /> <ProjectReference Include="..\..\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj" />
</ItemGroup> </ItemGroup>
<Import Project="..\..\..\build\NetFX.props" />
</Project> </Project>

10
src/tools/Avalonia.Designer.HostApp/Program.cs

@ -2,20 +2,19 @@
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
namespace Avalonia.Designer.HostApp.NetFX namespace Avalonia.Designer.HostApp
{ {
class Program class Program
{ {
#if NET461
private static string s_appDir; private static string s_appDir;
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{ {
string assemblyPath = Path.Combine(s_appDir, new AssemblyName(args.Name).Name + ".dll"); string assemblyPath = Path.Combine(s_appDir, new AssemblyName(args.Name).Name + ".dll");
if (File.Exists(assemblyPath) == false) return null; if (File.Exists(assemblyPath) == false) return null;
Assembly assembly = Assembly.LoadFrom(assemblyPath); return Assembly.LoadFile(assemblyPath);
return assembly;
} }
public static void Main(string[] args) public static void Main(string[] args)
{ {
s_appDir = Directory.GetCurrentDirectory(); s_appDir = Directory.GetCurrentDirectory();
@ -36,9 +35,6 @@ namespace Avalonia.Designer.HostApp.NetFX
} }
static void Exec(string[] args) static void Exec(string[] args)
#elif NETCOREAPP2_0
public static void Main(string[] args)
#endif
{ {
Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.Main(args); Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.Main(args);
} }

3
tests/Avalonia.DesignerSupport.Tests/DesignerSupportTests.cs

@ -101,6 +101,7 @@ namespace Avalonia.DesignerSupport.Tests
RedirectStandardOutput = true, RedirectStandardOutput = true,
RedirectStandardError = true, RedirectStandardError = true,
CreateNoWindow = true, CreateNoWindow = true,
WorkingDirectory = outputDir,
}, },
EnableRaisingEvents = true EnableRaisingEvents = true
}) })
@ -117,7 +118,7 @@ namespace Avalonia.DesignerSupport.Tests
cancelled = true; cancelled = true;
} }
Assert.True(cancelled); Assert.True(cancelled, $"Message Not Received.");
Assert.NotEqual(0, handle); Assert.NotEqual(0, handle);
proc.Kill(); proc.Kill();
proc.WaitForExit(); proc.WaitForExit();

Loading…
Cancel
Save