Cross Platform Applications written in Visual Basic .NET - vb.net

As I have seen there is a way through Xamarin and Visual Studio to develop cross platform applications in C#.
Is there a way to write cross platform applications with VB.net?
Is it possible Visual Studio 2017 to include this possibility?
Thank you!

You can use VB.net in a xamarin forms project. You have to use a vb.net PCL for the project. There is an article on the Xamarin site on how to do this.
https://developer.xamarin.com/guides/cross-platform/application_fundamentals/pcl/portable_visual_basic_net/xamarin-forms/
Please note there are a lot of limitations on this.
Custom Renderers cannot be written in Visual Basic, they must be written in C# in the native platform projects.
Dependency Service implementations cannot be written in Visual Basic, they must be written in C# in the native platform projects.
XAML pages cannot be included in the Visual Basic project - the code-behind generator can only build C#. It is possible to include XAML in a separate, referenced, C# portable class library and use databinding to populate the XAML files via Visual Basic models (an example of this is included in the sample).
Xamarin does not support the Visual Basic.NET language.

Related

VBA code: User is not a member of HelloWorld.My

I'm not new to programming, but am new to Microsoft-centric technologies. In this case, I have downloaded Visual Studio 2019 Community edition and am trying to get some stuff working as a VBA Console application.
Here is the link the the Visual Basic Guide I am using as documentation:
https://opdhsblobprod02.blob.core.windows.net/contents/c6aea4f5457448ee818b7292ba695982/8f8c9552565899a6bd5ea3443dc48752?sv=2015-04-05&sr=b&sig=z6HVPKMrsWrYMl1xp9Pk34R040%2B8A71q3nmRLNTG6lk%3D&st=2019-10-18T21%3A16%3A48Z&se=2019-10-19T21%3A26%3A48Z&sp=r
On Page #1 of that guide is a section titled "Development with My". 'My' can have various pieces, depending on the project type. In this case, my project type is: Console Application (from VS, File -> New -> Project, select: Console App (.NET Core) )
On page 59 of that guide is a table that explicitly shows which different parts of 'My' would be available in different project types. For a Console App, all of My.User, My.Resources, My.Setting should be available (as well as some other things).
Yet within my VBA code, the editor implies that the only part of 'My' available is a My.InternalXmlHelper. (I guess that comes by default - I haven't done anything to explicitly try to add such a thing.)
Obviously, some piece of the puzzle is missing here that enables access to all this wonder 'My' functionality that is described. Anybody know what needs to be done here so that my VS environment knows about My.User (and other stuff)?
Thanks.
.NET Core is a different beast altogether, in addition to the other languages you seem to be mixing together.
Based on this link, VB My namespace support is not a part of core 3.0. I'm not sure if it's in earlier core versions, because I haven't been working with VB in Core.
A large part of what makes Visual Basic special is the Visual Basic Runtime. .NET Core 2 contains only the small part of Visual Basic Runtime that is defined in the Visual Basic Language Specification which was initially designed for interop with phones.
The major effort for Visual Basic 16.0 will be moving the Visual Basic Runtime to .NET Core 3.0 to provide expected features like Mid or the My namespace. This work will probably not be ready for the first preview of .NET Core 3.0 but will appear in a later preview.
I think the guide you are working with is for .NET Framework 4.x and earlier (Core is a different initiative that involves getting .NET to run on multiple Operating Systems, etc.). Try creating a new .NET Framework app. The templates will have (.NET Framework) in the name, e.g., ASP.NET Web Application (.NET Framework).

No "Signing" Tab on Visual Basic .Net Standard Projects in Visual Studio

When creating a .Net Standard (Visual Basic) project in Visual Studio, the properties window presents no "Signing" tab. This is not an issue with .Net Standard (C#) projects, nor Visual Basic projects which are not .Net Standard.
Why this specific configuration, and is there any way to circumvent it?
In the end, I never found a way of automatically signing an assembly through Visual Studio's interface for this specific project template. However, I did find a workaround using custom build steps.
Visual Studio's interface also didn't allow this either, for whatever reason, so I had to manually edit the .vbproj file. Here's what it looked like in the end:
<PropertyGroup>
<PostBuildEvent>"Path\To\ildasm" /all /out=Project.il Project.dll</PostBuildEvent>
<PostBuildEvent>del Project.dll</PostBuildEvent>
<PostBuildEvent>"Path\To\ilasm" /dll /key="Path\To\Key.snk" Project.il</PostBuildEvent>
</PropertyGroup>
As you can see, all we're doing is disassembling the dll into an intermediate language file, and then reassembling it with a strong name
For the sake of simplicity (... and laziness), using project environment variables is left as an exercise to the reader :^).

Can I use FileHelpers with Xamarin

I would like to use FileHelpers in a Visual Studio 2017 project that compiles code for Android, is this possible?
Yes. FileHelpers works fine with Xamarin.
Furthermore, you can use the FileHelpers library in a .NET standard 2.0 project which is the recommended way for Xamarin applications to share code across multiple projects - one assembly used by both Android and iOS projects. See the documentation here.

Any changes needed to Visual Basic PCL for Xamarin Unified API?

I have a Visual Basic PCL for Xamarin. Will I need to make any changes to the PCL to be able to use it in a Xamarin Unified API project? Or just recompile perhaps?
I read that Visual Basic code requires no changes for 64 bits unless you are using the fact that it's 64 bits, which I am not.
You don't need to do any changes to PCL projects. The only projects who needs updating is iOS and Mac. For more information on updating that see the documentation: http://developer.xamarin.com/guides/cross-platform/macios/updating_ios_apps/

VS2008 non.NET Application

How can I create a VB application in VS2008 without requiring the application be run on a computer with a .NET framework in place?
You can't create a non-managed VB application in VS 2008.
You would have to use C/C++ or go back to VS 6.
You can look at the question below for more information on .NET linkers. That is technically an option, but if I were starting a new application that I didn't want to depend on the .NET framework I would not use a managed language.
Running .net based application without .net framework
You'll need to use a 3rd party .NET linker, Visual Studio itself doesn't support what you're after but a number of tools allow it to be done.
A couple of tools:
Remotesoft Salamander .NET Linker
Xenocode app virtualization
Another, non-VS, option is to use Mono to build a "Bundle" which combines both the runtime and your application into a single executable:
Mono:Runtime - Bundles
You can't. You would need to go back to Visual Studio 6 and create a VB6 app.
You can't. VB is .net based, there isn't a non .net VB anymore.
The best you can do is include the .net redistributable with your application's installation.