The name "MapViewModel" does not exist in the namespace

4584
6
07-01-2018 09:47 AM
PaulSmith4
New Contributor II

Trying to learn how to develop c# for ArcGIS.

Just getting started with creating a project, I get this error:

"I keep getting this error: The name "MapViewModel" does not exist in the namespace"

Full context of the error:

Severity Code Description Project File Line Suppression State
Error The name "MapViewModel" does not exist in the namespace "clr-namespace:ArcGISApp3". ArcGISApp3

Is there a version change that removed MapViewModel from the namespace?

Paul

0 Kudos
6 Replies
AnttiKajanus1
Occasional Contributor III

Hi,

ArcGIS Runtime hasn't got `MapViewModel` part of it at any point. This is part of the MVVM structure and while we recommend you to use it, using Runtime doesn't require it. From the implementation point of view, developers are responsible for building the ViewModel tier on their applications. Which documentation/guide you are using? I would expect to see mention on creating the ViewModel to your application being part of it.

PaulSmith4
New Contributor II

Hi Antti, Thanks for the quick reply.

I am using the online initial tutorial of getting started with .NET and

ArcGIS.

https://developers.arcgis.com/net/latest/wpf/guide/develop-your-first-map-app.htm

I installed the

I am new to ArcGIS but I have over 10 years of experience with C# and VB

on .NET for desktop apps and class structures. (I am primarily an AutoCAD

Map guru using .NET based classes and dll's for their product)

Paul

0 Kudos
AnttiKajanus1
Occasional Contributor III

I checked the tutorial and it seems that it is using the template that we provide as part of the SDK install. This will create you the `MapViewModel` so I'm assuming that you didn't use the template on your project and manually added references to the project through nuget. Here is an example what you should see if you create the project using the template.

 Hope this helps.

0 Kudos
PaulSmith4
New Contributor II

I did use the template. And I selected it to create the new project. That

what had me mystified as to why it would not work.

Paul

0 Kudos
PaulSmith4
New Contributor II

OK, got it now.

Before the C# code for that was missing. Now it's there. Strange.

Thanks for the help. I understand where it's supposed to be now.

Paul

AnttiKajanus1
Occasional Contributor III

Glad that you get that one fixed. I would assume that there was some type of error when creating the project on VS which didn't end up having the file for reason or another. If you keep seeing that in the future, please let us know. Also, welcome to the community.

Since you are new to our API/Platform, there definitely will be a lot to look into. Here is some inspiration

Get Started with Example Apps | ArcGIS for Developers  is a page where you can find our examples, which in this context means apps that are built to demonstrate how to solve some use cases with a "fully working open-source app". These are intended to highlight good practices and showing how to tie multiple functional areas to a single application.

GitHub - Esri/arcgis-runtime-demos-dotnet: Demo applications provided by the ArcGIS Runtime SDK for ...  is a repository where you can find all kind of demos. Where example apps are built around use-cases, demos are more API functionality based. Quite a few of these are used in our presentations as demos. 

GitHub - Esri/arcgis-runtime-samples-dotnet: Sample code for ArcGIS Runtime SDK for .NET – UWP, WPF,...  is a repository where you can find samples to highlight specific API usage.

One relatively new page is to look to Browse ArcGIS DevLabs | ArcGIS for Developers which contains short labs that you can do to learn specific things and you can chain some of them together as well. This is quite nifty so I recommend for you to have a look.

Ofc then we have the guide that you are already looking into. All the feedback is more than welcome. We are trying to make the process of learning our API/Platform easy as possible but there are a lot of things to show. So please let us know how you find the learning process.

0 Kudos