monodevelop won't compile VB code - vb.net

I wanted to have a look at monodevelop, thinking about possible moving in-house projects written in .Net from Windows to Linux.
I installed mono-complete 4.0.2 and monodevelop 5.9.4 on a clean Ubuntu 14.04 VM, I assume those are the latest/current versions.
Now C# works, but I can't get it to compile any VB code.
Any new VB project I create first refuses to load.
Quickly found (Google) that the mono VB compiler doesn't support framework 4 or higher yet, but the project template generates projects targeted at 4.5.
After I manually edit the project file to target 3.5, 3.0 or 2.0, the projects load (this works for console as well as GTK projects).
But when I try to compile it then, no own code added yet, just the auto-generated base code, it just fails without any error messages.
Build output:
Building: VbHelloConsoleWorld (Debug|x86)
Build started 7/3/2015 10:42:20 AM.
__________________________________________________
Project "/home/luc/projects/VbHelloConsoleWorld/VbHelloConsoleWorld.vbproj" (Build target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: x86
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Done building project "/home/luc/projects/VbHelloConsoleWorld/VbHelloConsoleWorld.vbproj".-- FAILED
Build FAILED.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.0438100
---------------------- Done ----------------------
Build successful.
Am I still missing some dependencies? Other stuff that must be fixed before a VB project will work?

For some reason building VB.NET with MSBuild does not work.
To workaround this you can disable the use of the MSBuild build engine. Go into project options, Build - General and uncheck Use MSBuild build engine. Then the project should compile and generate an output assembly.

Related

Cannot build Python.NET Python.Runtime in Visual Studio from master, or via setup.py

I tried to "Build Solution" from Visual Studio 2019, since the Python.NET project comes with a .sln VS Solution file
However, it skipped the Python.Runtime build which is what I'm interested in:
1>------ Skipped Build: Project: Python.Runtime ------
Furthermore, the other 4 builds had an error:
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\NuGet\16.0\Microsoft.NuGet.targets(186,5): error : Your project file doesn't list 'win-x64' as a "RuntimeIdentifier". You should add 'win-x64' to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.
Alternatively, when running python setup.py following instructions on https://github.com/pythonnet/pythonnet/wiki/Installation#github-installation-from-master-branch, I ran into another error from not being able to find Windows Kits installed roots. Have been looking around for answers and tried different versions of Python, .NET Core, .NET etc. to no avail. I detailed it in https://github.com/pythonnet/pythonnet/issues/1272
Environment
Pythonnet version: 3.0 (ongoing, latest master branch ending at c81c3c3)
Python version: 3.7.9
Operating System: Windows 10, 64bit, WinPE
I just loaded pythonnet.15.sln instead of pythonnet.sln and was able to build the DLL file.
Although I'm still not sure why pythonnet.sln didn't work for me, does "15" refer to the VS version? The regular sln was being used in this screenshot from a talk https://youtu.be/P7Or7XzeIno?t=1163

How to run Sonar Scanner on a Visual Studio 2019 solution?

We started to use VS2019 and all the new things that comes with. We noticed that the build manager doesn't work anymore:
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
1. The project has not been built - the project must be built in between the begin and end steps
2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 and 15.0 are supported
3. The begin, build and end steps have not all been launched from the same folder
4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
I checked, but I thing I've the latest version of SonarScanner installed. I'm kind of stuck, how to execute all our tests if we use some things of the MSBUILD V16(2019) compiler, but sonar cube doesn't seems to be compatible?
Is there a workaround?
Thanks

MsBuild failing for .Net Standard project with error "Package System.Security.Cryptography.ProtectedData, version x.x.x was not found"

Project Setup : Mixed framework solution
.Net Framework 4.6.2 projects in solution : 15
.Net Standard 2.0 projects in solution - 1
Development Machine
Visual Studio 2017(15.7.4) : Builds without any errors
Build Server
TeamCity Version 2017.1.3
Build Steps
Nuget Restore(3.4.4)
dotnet Restore
MSBuild( Build Tools 2017), Tools Version 15.0
Build fails with following error in the .net standard 2.0 project : [ResolvePackageAssets] C:\Program Files\dotnet\sdk\2.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198, 5): Package System.Security.Cryptography.ProtectedData, version 4.4.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.
What's interesting is I can't find reference or use of System.Security.Cryptography.ProtectedData anywhere in the project. Any help is greatly appreciated.
P.S - Can't use dotnet build, as the solution needs building of licenses.licx files, and the component which builds it (Microsoft.Build.Tasks.LC) is not ported to .Net Core. The suggestion from various posts was to use MsBuild.exe

Typescript NuGets: compiler vs msbuild

There are two NuGets offered by Microsoft for Typescript.
Compiler
MsBuild
I have a visual studio project that I want to run on an old build machine that does not have a current Typescript installed (It is running TFS Build 2010).
But I need to build my project with a new version of Typescript.
Do I need the compiler or msbuild nuget? (Or are neither of them going to work for what I need?)
Update: I tried the MsBuild version and it took my working project and broke it. I got a ton of compiler errors. (Cannot find name.... errors).

Why can't MSBuild ToolsVersion 4.0 build older projects?

We're using Cruse Control to manage our build process.
AS we convert vs2008 projects to vs2010, we're leaving the target framework set at 3.5 for web and class library projects.
At this point we're not going through and converting all our solutions to vs2010; not if we don't have to.
I recently updated the MSbuild project files that cruise control uses to point at MSBuild 4.0 so our build process would be able to build vs2010 projects.
C:\windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
All was well until a web project that was targeting the 4.0 framework was committed.
At which point this error popped up:
CS0433: The type 'System.Web.Routing.RouteCollection' exists in both c:\Windows\Microsoft.NET\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll and c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Routing.dll in Global.asax.cs(15, 43)
At which point I became aware of the Windows/Microsoft.NET/Assembly folders.
Now... All the MSBuild projects, even though they were using MSBuild 4.0, still had the tools version set at 3.5.
So why was a 3.5 targeted build looking at the new 4.0 assembly folders and finding this conflict? Probably because I was using MSBuild 4.0. But if I can change the toolVersion that MSBuild uses, you'd think I can tell it to target 3.5 without worrying about these potential conflicts.
To resolve this issue, I went to the relevant MSBuild project files that cruise control uses and changed their toolsVersion to 4.0. This got passed that conflict error. But now everytime it tries to build a project that's in a solution that we haven't yet converted to a vs2010 project, it breaks with an error like this:
MyProject.csproj in SomeFilePath:
LC0000: 'Could not load file or assembly or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.' in LC(0, 0)
If I open the solution that contains that project in Visual Studio 2010 and do the conversion, build it and commit that and force another build, I get passed that error only to find that another not yet converted project is tossing that same error.
So now I am for sure using MSBuild 4.0 and for real targeting the 4.0 framework. Why can't 4.0 build 3.5 projects or vs2008 solution projects?
The issue is that you have migrated part of your projects to to visual studio 2010. Any 2008 project that references a 2010 project (by project reference) will give you this compile time error. Try updating all .csproj files to 2010 and try rebuilding again.