Errors running Google API calendar example for vb.net - vb.net

When I try to run this example in VBExpress 2010, I get the following intellisense errors.
scopes.Add(CalendarService.Scopes.Calendar.GetStringValue())
This line generates:
Error 7 Overload resolution failed because no accessible
'GetStringValue' is most specific for these arguments:
Extension method 'Public Function GetStringValue() As String' defined in 'Google.Apis.Util.Utilities': Not most specific.
Extension method 'Public Function GetStringValue() As String' defined in 'Google.Apis.Util.Utilities': Not most specific.
Additionally, these two lines each generate a "not defined" error.
Dim credentials As FullClientCredentials = promptingClientCredentials.EnsureFullClientCredentials()
Dim initializer As New BaseClientService.Initializer()
Error 9 Type 'BaseClientService.Initializer' is not defined.
Error 8 Type 'FullClientCredentials' is not defined.
Finally, this line:
Dim state As IAuthorizationState = AuthorizationMgr.GetCachedRefreshToken(STORAGE, KEY)
generates the error:
Error 15 'AuthorizationMgr' is not declared. It may be inaccessible
due to its protection level.
As to the first error, both google.apis.silverlight.google.apis.util.utilities and google.apis.google.apis.util.utilities has a GetStringValue(system.enum) as String method.
Any ideas about any of these errors?
UPDATE: Excluding Silverlight dll seems to resolve first error ("Not most specific")

We just published a new sample using VB.NET and OAuth2.
It works in VS Professional 2012. Take a look - http://samples.google-api-dotnet-client.googlecode.com/hg/Calendar.VB.ConsoleApp/README.html

Related

I have two types of Errors in Blazor Server that appear in razor.g.cs files (upgrading to preview 9)

I created a preview 9 server blazor project and attempted to convert an existing preview 6 to it, Using a guide that is public in the internet. I get two types of errors (35 errors) that appears in razor.g.cs files:
Error CS1662 Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type BlazorStore9 C:...\obj\Debug\netcoreapp3.0\Razor\Pages\Admin\EditProductComponents\AddEditProductDescriptionImage.razor.g.cs
and
Error CS1503 Argument 6: cannot convert from 'Microsoft.AspNetCore.Components.EventCallback' to 'Microsoft.AspNetCore.Components.EventCallback' BlazorStore9 C:...\obj\Debug\netcoreapp3.0\Razor\Pages\Admin\EditProductComponents\AddEditProductDescriptionImage.razor.g.cs 326 Active
I managed to solve all the errors (thousands) based on that guide, but finally stop here, how do I solve this?
Solved:
The error raised because new Radzen file input version expects a TValue="string" attribute for setting up its callback.

Using COM object from PowerBuilder - error 36: name not found accessing external object

I'm trying to access a third-party COM server from within Powerbuilder. I can instantiate the object but whenever I try to call a method or a property on the object I get error 36: "name not found accessing external object".
OLEObject PNSession
PNSession = CREATE OLEObject
ll_status = PNSession.ConnectToNewObject("PNSrv9.PNSession")
if ll_status = 0 then
// Set the session printer
try
PNSession.SetSessionPrinter('TIFF Image Printer 9.0', 1, g_pfapp.null_string, False)
catch (oleruntimeerror lole_error2)
messagebox('Set Error', lole_error2.description)
end try
// Turn job tracking on
PNSession.TrackingOn = True
end if
The ConnectToNewObject call succeeds and I see the COM server in my Task Manager, but subsequent calls fail. The above looks correct based on all the COM automation code samples for Word, Excel that I looked at.
The COM server is a C++ ATL COM Server, not a .NET COM object if that makes any difference.
Does anyone have an idea why this isn't working or what I am missing?
Thanks.
You probably don't have the parameter types correct. Looking at SetSessionPrinter, I would try passing 0 for PortsPreCreated. For PortBaseName try a string initialized to "" and also try 0.
Similarly, try PNSession.TrackingOn = 0.

Unity Container Type Registration Quirk

I'm trying to automatically register all reports in a unity container.
All reports implement IReport and also have a Report() attribute which defines the title, description and unique key (so I can read these without instantiating a concrete class).
So...
I get the report types like this
Public Shared Function GetClassesWhichimplementInterface(Of T)() As IEnumerable(Of Type)
Dim InterfaceType = GetType(T)
Dim Types As IEnumerable(Of Type)
Types = Reflection.Assembly.GetCallingAssembly.GetTypes()
Return Types.Where(Function(x) InterfaceType.IsAssignableFrom(x))
End Function
And register them like this:
Public Sub RegisterReports()
Dim ReportTypes = ReflectionHelper.GetClassesWhichimplementInterface(Of IReport)()
For Each ReportType In ReportTypes
''Previously I was reading the report attribute here and using the defined unique key. I've stopped using this code to remove possible problems while debugging.
Container.RegisterType(GetType(IReport), ReportType, ReportType.Name)
Next
End Sub
There are types being returned by the call to GetClassesWhichimplementInterface() and the Container.RegisterType() call is made without errors. If I call Container.Resolve(of Interfaces.IReport) immediately after the register call, I get the following exception:
Resolution of the dependency failed, type = "MyProject.Interfaces.IReport", name = "(none)".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The current type, MyProject.Interfaces.IReport, is an interface and cannot be constructed. Are you missing a type mapping?
-----------------------------------------------
At the time of the exception, the container was:
Resolving MyProject.Interfaces.IReport,(none)
Can anyone tell me why the container isn't preserving the registration?
The registration is in the container. The thing is that you are calling resolve without passing a named registration as a parameter.
As all your registrations were performed using the following code:
Container.RegisterType(GetType(IReport), ReportType, ReportType.Name)
Then all of them have a name. You must provide the name along with the type to be able to resolve the dependency from the container.
The error you are getting is because there is no type mapping registered without a name.

Code Analysis Error: Declare types in namespaces

Is VS2010, I analyzed my code and got this error:
Warning 64 CA1050 : Microsoft.Design : 'ApplicationVariables' should be declared inside a namespace. C:\My\Code\BESI\BESI\App_Code\ApplicationVariables.vb 10 C:\...\BESI\
Here is some reference info on the error. Essentially, I tried to create a class to be used to access data in the Application object in a typed way.
The warning message said unless I put my (ApplicationVariables) class in a Namespace, that I wouldn't be able to use it. But I am using it, so what gives?
Also, here is a link to another StackOverflow article that talks about how to disable this warning in VS2008, but how would you disable it for 2010? There is no GlobalSuppressions.vb file for VS2010.
Here is the code it is complaining a bout:
Public Class ApplicationVariables
'Shared Sub New()
'End Sub 'New
Public Shared Property PaymentMethods() As PaymentMethods
Get
Return CType(HttpContext.Current.Application.Item("PaymentMethods"), PaymentMethods)
End Get
Set(ByVal value As PaymentMethods)
HttpContext.Current.Application.Item("PaymentMethods") = value
End Set
End Property
'Etc, Etc...
End Class
I suspect that the code you entered is in your App_Code fodler of your web app. This code is accessible from your web code as you have deomnstrated but is not accessible from any other assembly.
You can suppress the instance of the error by right mouse clicking on the particular error and selecting "Suppress Message In Source." That'll result in code being added to your source that says "the next time you check this error-fuggedabodit!"
When to Suppress Warnings
--------------------------------------------------------------------------------
While it is never necessary to suppress a warning from this rule, it is safe to do this when the assembly will never be used with other assemblies.
To suppress the error on all occurences, select "Suppress in Project Suppression File"

Getting mapping error. After dragging table with xml fields into dbml file and then compiling

"Error 1 DBML1005: Mapping between DbType 'Xml' and Type 'System.Xml.Linq.XElement' in Column 'XML_LAYOUT' of Type 'QUEST_BLOCK' is not supported."
The above is the error am getting. What am doing is dragging a table with xml fields as columns from server explorer into a dbml file. After that when i compile i am getting the above error. Now after that i changed server datatype to blank. Now the program compiles successfully. But at runtime if i query the table directly using WCF in silverlight the function is showing error. After a debug i found that the select statement on the table is returning the rows in the funtiion, however the error is produced in the reference file in the following function.
Public Function EndGetQuestionListRecord1(ByVal result As System.IAsyncResult) As ServiceReference1.QUEST_BLOCK Implements ServiceReference1.Medex.EndGetQuestionListRecord1
Dim _args((0) - 1) As Object
Dim _result As ServiceReference1.QUEST_BLOCK = CType(MyBase.EndInvoke("GetQuestionListRecord1", _args, result),ServiceReference1.QUEST_BLOCK)
Return _result
End Function
Hope someone around here could resolve this error...
rideonscreen, recently I started getting the same type of error. In my case I get it dragging a stored procedure with a XML input parameter.
I wonder whether you managed to resolve the issue and how.
I googled and found some articles:
http://dev.techmachi.com/?p=319
http://www.west-wind.com/Weblog/posts/505990.aspx
http://www.jonathanjungman.com/blog/post/Visual-Studio-Build-failed-due-to-validation-errors-in-dbml-file.aspx
"devenv /resetskippkgs" helps, but next day the issue appears again.
What is also interesting that I do not touch the LINQ2SQL model (dbml file) at all. The code there is the same for a long time. The issues is definitely exclusively related to Visual Studio.
P.S. I am thinking to migrate to EF.