Create DLL of WPF Application

2437
4
01-25-2021 11:13 AM
RamS1
by
New Contributor

I need immediate assistance. Please steer me to correct direction.

I have installed ArcGIS Runtime SDK for .NET.  I have briefly reviewed sample code at https://developers.arcgis.com/net/latest/wpf/sample-code/

I am unable to figure out a way to create DLL of WPF application. I can create a user control (*.ascx) and create a dll using Visual Studio.Net. Is there a way I can create a DLL that can be utilized.

 

Your help is much appreciated

Ram

 

0 Kudos
4 Replies
JoeHershman
MVP Regular Contributor

That's a pretty broad question.  To create a dll one just needs to change the output type to class library in the project properties.  However, an application needs an entry point (an .exe) so you still need to have a wpf application compiled as an exe.  But you can use dlls that have been developed with the API and reference than and use that functionality as would be done with any other type of application

Thanks,
-Joe
0 Kudos
RamS1
by
New Contributor

Thanks Joe for your response. I created a brand new project "ArcGIS Runtime App(WFP .Net Framework". I went to project properties and changed to 'Class Library' from  'windows Application.  I am getting several errors.

'Library Project file cannot speicfy ApplicationDefination element package 'Esri.ArcGISRuntime.runtime.win 100.0.0

I have tried all 3 types of ArcGIS application. Any other help is appreciated. Thank you!

 

0 Kudos
JoeHershman
MVP Regular Contributor

What is your ultimate goal?  There is nothing different about using the Runtime API than using any other API.  A WPF application will need an entry point, if you use the WPF application project template you get all the setup for the main application.  If you are trying to create a project to use in another application you could create use a class library.  But this needs to be referenced in a WPF application and the map added in some way to the main application

Thanks,
-Joe
0 Kudos
dotMorten_esri
Esri Notable Contributor

I would recommend creating a nuget package instead of a DLL. The DLL itself isn't enough - there's a bunch of resources that needs to get deployed as well (native libs, pixel shaders and various other resources etc).

A nuget package declaring a dependency on our nuget package will ensure things get deployed correctly.

This is only for sharing the DLL though. You can always create a class library, and use a project reference to the class library, and it should "just work"

0 Kudos