Hello,
I’m attempting to build one of the WPF examples on a machine that has no internet access. I get the error mentioned in the title. When I exported the project, I selected the “Installation Folder” option rather than the “NuGet Package”.
How can I fix this error?
Thanks, Brett S.
- Brett Stahlman asked 6 months ago
- You must login to post comments
Hi Brett,
I just tried this locally. When exporting a chart example to a stand-alone project from the SciChart WPF Examples App, if you select ‘Local Installation Folder’ then the exported project will reference the SciChart libraries found on disk, assuming that you’ve installed the SciChart SDK on that computer.
If you have the libraries elsewhere, you can change the installation directory.
The output *.csproj file looks like this for me. Here you can see the project references and their paths.
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
</PropertyGroup>
<PropertyGroup>
<Copyright>Copyright © 2011-2023</Copyright>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="SciChart.Core">
<HintPath>C:\Users\aburn\AppData\Local\Programs\SciChart\SciChart SDK\ExamplesBin\net462\SciChart.Core.dll</HintPath>
</Reference>
<Reference Include="SciChart.Data">
<HintPath>C:\Users\aburn\AppData\Local\Programs\SciChart\SciChart SDK\ExamplesBin\net462\SciChart.Data.dll</HintPath>
</Reference>
<Reference Include="SciChart.Charting">
<HintPath>C:\Users\aburn\AppData\Local\Programs\SciChart\SciChart SDK\ExamplesBin\net462\SciChart.Charting.dll</HintPath>
</Reference>
<Reference Include="SciChart.Charting3D">
<HintPath>C:\Users\aburn\AppData\Local\Programs\SciChart\SciChart SDK\ExamplesBin\net462\SciChart.Charting3D.dll</HintPath>
</Reference>
<Reference Include="SciChart.Drawing">
<HintPath>C:\Users\aburn\AppData\Local\Programs\SciChart\SciChart SDK\ExamplesBin\net462\SciChart.Drawing.dll</HintPath>
</Reference>
<Reference Include="SciChart.Charting.DrawingTools">
<HintPath>C:\Users\aburn\AppData\Local\Programs\SciChart\SciChart SDK\ExamplesBin\net462\SciChart.Charting.DrawingTools.dll</HintPath>
</Reference>
<Reference Include="SciChart.Examples.ExternalDependencies">
<HintPath>C:\Users\aburn\AppData\Local\Programs\SciChart\SciChart SDK\ExamplesBin\net462\SciChart.Examples.ExternalDependencies.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
<PackageReference Include="MahApps.Metro.IconPacks.Material" Version="4.11.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.6.2</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
</ItemGroup>
</Project>
However, the exported project if you notice still has two PackageReference
nodes which will pull packages from NuGet: Microsoft.Xaml.Behaviors.Wpf
and MahApps.Metro.IconPacks.Material
.
This is probably why the exported solution is failing to compile on a system without internet access.
What can you do about this?
You could:
- Download these libraries from NuGet yourself and reference them manually, locally. E.g. the ‘Download Package’ button on nuget.org/packages/MahApps.Metro.IconPacks.Material downloads a *.nupkg file. Rename the file extension to *.zip and you can open it like an archive to get the libraries out.
- You could try recreating the example yourself using the exported code as a starting point
- Alternatively, you could remove these PackageReferences and fix the resulting compiler errors.
For (3), both are used by the SciChart.Examples.ExternalDependencies
assembly which is a helper DLL that contains styles, buttons, the SciChartInteractionToolbar
type which is present in many of the examples.
Removing this won’t affect the chart but it might affect example functionality depending on which example you exported. The SciChart.Examples.ExternalDependencies
package is not recommended for referencing in production code. However, if you want to use any of the styles, classes, toolbars or types in there in production code, they can be found in our open source SciChart.Wpf.Examples repository
- Andrew Burnett-Thompson answered 6 months ago
- last edited 6 months ago
- You must login to post comments
Andrew,
I appreciate the clear explanation and suggested remedies. I’ll probably try solution #3, since downloading is a problem on this particular system.
Thanks, Brett S.
- Brett Stahlman answered 6 months ago
- last edited 6 months ago
-
No problem, it’s a good Q&A actually as others may hit the same issue. I could recommend #4 – export them all on another computer and compile before moving the projects, including downloaded & cached packages over
- You must login to post comments
Please login first to submit.