I want to suppress FXCOP error(CA1811) for specific vb.net function.
Like <SuppressMessage()> in c#, do we alternative of this in VB.net?
I am new to vb.net.
FXCop analyzes the compiled assemblies, i.e., it doesn't care whether the assembly was written in C# or VB.NET.
Thus, the same technique that works in C# should also work in VB.NET. Note that, in VB.NET, the syntax for adding attributes is [SuppressMessage(...)] rather than C#'s <SuppressMessage(...)>.
Related
I am working on migration of VB6 Application to VB.net.
the VB6 code uses ChrB quite often and I need to know how to convert it into vb.net
has anyone faced any similar issue..?
Regards,
Rasheed
VB.NET doesn’t support “byte-oriented” string methods.
VB Migration Partner provides the ChrB6 replacement method, which approximates the original VB6 method’s behavior but isn’t guaranteed to work well in all circumstances. This replacement method is marked as obsolete and methods invocations are flagged with a migration warning.
This might be as rare as a ginger unicorn, however, is there a source-to-source (transcompiler) that compiles down to vba?
I've got some c# financial functions that would be great to reuse in vba.
So after much searching it appears there isn't a transcompiler available as of 06/Aug/2014.
It would appear that people either:
(a) code directly in vba and accept the limitations of the language and tooling
or
(b) create a c# dll and reference from the vba host
e.g. A Simple C# DLL - how do I call it from Excel, Access, VBA, VB6?
I am building an application in VB (VS2012) and the main code is written in Matlab. I would like to call the Matlab scripts from the VB form and also display the results of the calculations in the VB form in a datagrid. Can somebody suggest what my mode of exchange should be?
Thanks for the help.
You have two main options.
MATLAB has a COM interface. From VB, you can start an instance of MATLAB, pass data to it, execute commands, retrieve results, and quit MATLAB. To find out more, take a look at the documentation pages for the MATLAB COM Automation Server. This method will require you to have a live copy of MATLAB present when you run your VB application.
You can use an add-on product to MATLAB, MATLAB Builder NE for .NET (you'll also require another add-on that it depends on, MATLAB Compiler). MATLAB Builder NE allows you to convert your MATLAB code into a standalone .NET assembly or COM component that can be called from your VB application, and distributed with it.
Note that contrary to a comment, MATLAB Compiler alone without MATLAB Builder NE does not allow you to produce .NET assemblies.
When I add my vb classes to my C# project in vs 2008 they are readily available to be used in my c# classes. But for some reason 2010 can't see them. I could be missing something simple but i couldn't make it work in the past hour. Any ideas?
Are you sure you had them included with action compile and not just action content?
CSharp and VB use two differnt MSBuild targets file and I've never heard of mixing them in the same project file. Different project types in the same solution - sure, but not what I think you are saying.
Of course it's a strange world so maybe someone will come by and suprise me with something I never thought possible outside of ILMerge after the build.
you can't mix 2 code languages. like you can add vb and vb, c# and c# but not vb and c# together.
If you do want to mix, use a code converter like c# - vb or something. Here is one to try instead of re coding it all again: Vb.net --> C# converter.
It may not be 100% working but at least you'll convert some code.
I have some C# source code that I got off the Internet and I want it in VB.NET. How would you convert it because I don't know C#.
I found multiple translators after performing a simple search, but this one looks kind of cool. No installation necessary!... though I have never used it.
Another way is compiling it to, dragging the assembly to Reflector and then decompiling it to VB.NET
If I recall correctly, you can have multiple source languages in the same project. They just have to be in different files. You should be able to call the c# class from a vb.net class without any major problems. This may not be the prettiest option, but it might work for your situation.
You can have a VB project in the same solution as a C# project, and use classes from either from the other, but you can't have both VB and C# source files compiled in the same project.