Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, April 17, 2018 2:12 PM
Hello,
I have a Desktop WinForms Application. After installing NuGET package for new Report Viewer Control from https://www.nuget.org/packages/Microsoft.ReportingServices.ReportViewerControl.Winforms/ - the instruction to correctly deploy it is:
For desktop applications, add the following line of code to run before any spatial operations are performed:
SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
Can you please tell where exactly this line should be added? I am getting "'SqlServerTypes' is not declared. It may be inaccessible due to its protection level..." when added in the code.
Thank you
All replies (5)
Monday, April 23, 2018 12:31 PM âś…Answered | 1 vote
Thanks Fletcher!
The solution was to copy/move Loader.cs to the project files. When nuget loaded, it is not added to the project automatically.
Wednesday, April 18, 2018 5:37 AM
Did you install Microsoft.SqlServer.Types at your machine?
Regards,
Fletcher
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Wednesday, April 18, 2018 9:47 AM
Hi Fletcher,
Yes. It is installed with the NuGET package:
Microsoft.ReportingServices.ReportViewerControl.Winforms https://www.nuget.org/packages/Microsoft.ReportingServices.ReportViewerControl.Winforms/
locally in my project folders.
I have some spatial data types (geography) in the code working correctly.
Friday, April 20, 2018 9:41 AM
Add this line before calling any spatial operation:
SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
and this blog might help.
Regards,
Fletcher
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Tuesday, April 24, 2018 9:01 AM
You could mark your reply as answer if you've found the solution.
Thanks for your cooperation:)
Regards,
Fletcher
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].