A major project of mine has developed this error. This started when I was working in Visual Studio 2015. I have since reloaded the Nuget packages, reloaded the SDK, Installed the newest version of Visual Studio (2017), built a brand new trivial app that just tries to display a map in a user control and more or less tried everything. There was a recent question about it, but it wasn't helpful. Nothing I do fixes the problem...
This is at design time and it's a visual basic app. Anything I try all boils down to the same error...
The deployment folder is there. And... I can compile my application and it runs perfectly! But at design time, it can't render my main form, and instead gives the above error. I have attached an image of what Visual Studio does when I try to load the form that hosts the WPFMap user controls. I am dead in the water. At this point, I may have to move to a different development machine and try a clean install of Visual Studio and the .net SDK.
I have done all of those things multiple times. It's like there is a registry setting or a configuration entry that persists. I even installed VS 2017 (The problem original showed up while I was working in VS 2015) thinking it was something corrupt on the Visual Studio side. The problem followed. What is crazy is the app runs fine. I can compile and it runs. I just can't bring it up the form in the Visual Studio designer. I need to make changes, but Visual Studio errors loading the form.
I have same problem like you. the app runs well but the form can not be opened. So if I want to change the form, I have to remove the usercontrol map. then I add back. I hope any solution to fix this problem.
<PlatformTarget Condition=" '$(PlatformTarget)' == '' ">$(Platform)</PlatformTarget>
To your .csproj file. The target inside the nuget package uses the PlatformTarget property to determine which dlls to copy to the output directory. Mine wasn't set because my project uses Platform instead of PlatformTarget and so I encountered this bug.
I'm a little surprised this property isn't set in your project, but we've heard this happening a few times. I'd like to better understand what is causing this so we can avoid it in the future. Is there any chance you could share the .csproj file with me, as well as some info about which version+patch of Visual Studio you use and how you create the project to begin with (ie which project template etc)? Either share here or email me at email@example.com
I use JetBrains Rider with MSBuild 16. Our CI system is TeamCity which builds using MSBuild 15 and the project was probably created in Visual Studio 2017 with the default template for WPF projects. The project file is 228KB so I'll email it to you on request.
For anyone facing this issue on vs 2019, make sure you have project folder permissions on full control.
Also make sure that arcgis.runtime.win nuget package is installed.