configuration 1: building ESRI add-ins for ArcMap 10.4 using Visual Studio 2015 targeting the .NET 4.5.2 framework
configuration 2: building ESRI add-ins for ArcMap 10.3 using Visual Studio 2013 targeting the .NET 3.5 framework
configuration 3: building ESRI add-ins for ArcMap 10.4 using Visual Studio 2013 targeting the .NET 4.5.2 framework
I'm trying to understand why the Option Strict On enforcement in VB.NET projects does not raise error BC30512 in two projects and it does in another. Here is an an example line of code that triggers the error using configuration 1 but does not trigger the error with configuration 2 or 3.
Dim bufferedPolygon As ESRI.ArcGIS.Geometry.IGeometry = New ESRI.ArcGIS.Geometry.Polygon
Additionally, if I instantiate the managed class instead of the coclass, the error is not triggered in either configuration (see following line):
Dim bufferedPolygon As ESRI.ArcGIS.Geometry.IGeometry = New ESRI.ArcGIS.Geometry.PolygonClass
The different versions of ArcMap dictate which version of the framework is targeted. For additional background, the COM to .NET Type Conversion of the ArcObjects documentation is relevant:
Using ArcObjects (COM-based) in .NET (ArcObjects .NET 10.4 SDK)
Why is the error triggered in configuration 1 and not in configuration 2 or 3? And why isn't the error triggered in configuration 1 when instantiated with the managed class instead of the coclass?
Link to an issue submitted at the dotnet/roslyn github repository.
https://github.com/dotnet/roslyn/issues/13314
Thanks
Shea
At this time, it appears (as Hans Passant suggested in a comment on the original post) that this is indeed a bug with the Roslyn compiler in Visual Studio 2015. I opened an issue at the dotnet / roslyn GitHub repository, and it has been labeled a bug and assigned to a team member. The status of this could change as the issue is investigated.
The link to the issue and additional troubleshooting information is https://github.com/dotnet/roslyn/issues/13314
Related
I have to continue a program witch have been coded with Visual Studio and the framework .NET framework 4 but the thing is : I have a macbook.
After many researches I have found that by using Mono it was possible to code in vb.net with a mac. However, the project is working on Windows computer but I get this warning:
"warning MSB3256: No assemblies were read in from the redist lists. A TargetFramework profile exclusion list could not be generated."
and this error:
"error MSB6006: "vbnc.exe" exited with code 1"
So I'm guessing that he doesn't recognize that mono should replace .NET framework. I am executing the code with MSbuild, maybe that is the issue?
Unfortunately you are stuck.
Microsoft would like to bring C#/VB and .NET Core to Mac via Visual Studio for Mac, so you should not attempt to bring any .NET Framework projects to Mac via Mono any more.
This warning is more critical to VB developers, as Mono's VB support (vbnc.exe is Mono VB compiler) is experimental and does not support all VB latest features.
However, for .NET Core development, VB is also not yet ready to be used, and should be available in a few months when Microsoft ships .NET Core 2.0.
You can definitely play with VB by using .NET Core 2.0 Preview build,
https://www.infoq.com/news/2017/05/netcore2preview
But then you cannot use VS for Mac, and have to use an editor such as Visual Studio Code.
For some reason, Mono uses vbnc by default although there is a Roslyn-based VB compiler built-in to Mono, vbc. Interestingly, vbnc is even not being installed with mono-devel package and it still being used by default.
If you installed vbnc and started to get this message:
"error MSB6006: "vbnc.exe" exited with code 1"
you need to instruct Mono to use vbc instead and your code will build. The most reliable way to do it is to set it per project, by adding the following XML to your vbproj file:
<PropertyGroup>
<VbcToolExe>vbc</VbcToolExe>
</PropertyGroup>
The code should be placed inside the root <Project> tag.
I am using ReactJs.NET in a ASP.NET MVC 4 project. I have disabled the fallback to MSIE javascript engine by specifying this in my ReactConfig.cs that is called on app start:
ReactSiteConfiguration.Configuration.SetAllowMsieEngine(false);
This works on my developer machine but not in production. The exception that is thrown is:
Failed to initialise ClearScript V8. This is most likely caused by the native libraries (ClearScriptV8-64.dll and v8-x64.dll) missing from your app's Bin directory, or the Visual C++ runtime not being installed
I have ensured that the ClearScript.V8 folder (with ClearScriptV8-64.dll and v8-x64.dll) is copied across to the production server and the bin folder so I am currently looking at whether the Visual C++ runtime is missing or not. I downloaded and installed the Visual C++ Redistributable for Visual Studio 2015 located here: https://www.microsoft.com/en-us/download/details.aspx?id=48145 but the same exception is thrown.
Is there something obvious I am missing here? Is it the wrong Visual C++ runtime that I have installed?
Are those DLL files in a ClearScript.V8 folder? They need to be at bin\ClearScript.V8\ClearScriptV8-64.dll for example.
Alternatively, you can try out the release candidate of ReactJS.NET 3.0, which uses a newer version of JavaScriptEngineSwitcher that changes how V8 is loaded and no longer requires the DLL files to be manually copied over. There's currently no documentation on ReactJS.NET 3.0 but it's pretty similar to the current 2.x version. I'll be working on the documentation for the final release soon.
In my case I managed to resolve this by installing the Visual C++ 2013 runtime, this was the only version that actually worked in this case. I had no luck with neither 2012 or 2015.
I found the answer here:
https://github.com/reactjs/React.NET/issues/80
and the comment that helped me was:
Just another note, ClearScript 5.4.4 readme says VS2015 or 2013 C++
runtimes will work, but in my experience, it only worked when 2013's
was present.
I created a new ASP.NET 5 preview project in VS 2015 RTM (fully updated). When I try to debug it, it fails with the following exception:
The current runtime target framework is not compatible with
'ProjectName'.
Current runtime Target Framework: 'DNX,Version=v4.5 (dnx45)' Type:
CLR Architecture: x86 Version: 1.0.0-beta6-12256
Please make sure the runtime matches a framework specified in
project.json
I went with the default settings in the new project dialog, which I believe included a dependency on .NET 4.5.1 (though there's no mention of that dependency in the project.json file - contrary to what the exception message claims). I tried the solution offered here (defining the DNX_IIS_RUNTIME_FRAMEWORK environment variable in the project's debug settings) without success.
Install latest tools and try again. Beta 6 isn't apt to be supported and lots changed since then. You can get the tools here: http://www.microsoft.com/en-us/download/details.aspx?id=49442
I have recently installed VS2015. Yay! \o/
However, one of my C++/CLI projects showed this message when upgrading from VS2013:
The following project(s) uses an earlier version of the Visual C++ compiler and libraries. The project(s) will be upgraded to use the Microsoft Visual Studio 2015 compiler and libraries. Any managed or native code project(s) using C++/CLI extensions will be automatically upgraded to target .NET Framework 4.5.2. Note: If you do not upgrade the project(s), building your project(s) will require the corresponding version of Visual Studio to be installed.
I ok'd the warning, but now code which compiled previously in VS2013 no longer compiles, for instance:
void WritePixels(array<unsigned int> ^ rgbaData);
has the error
'std::array': too few template arguments
'^': cannot use this indirection on type 'std::array'
Also the project properties do not allow me to switch target .NET framework version (it is grayed out).
Is it possible for C++/CLI projects to target .NET 4.0 using Visual Studio 2015? Are there any syntax changes in C++/CLI since Visual Studio 2013 that I need to know about?
Just an update for posterities sake.
I solved this by workaround, by not using C++/CLI at all, but using the amazing, adaptable SWIG Platform Invoke Generator library.
No C++/CLI = no issues with .NET Framework versions, no issues with x64/86 bit and .NET Any CPU.
Problem Solved ...
I have no problem building my VB project in both VS 2010 and 2012 againt .NET 2.0.
However, the MSBuild refuses to build it because it does not like one VB language feature introduced in VS 2010 (it is "implicit line continuation" to be more specific).
I tried the following parameters for MSBuild (from .NET 3.5):
/p:TargetFrameworkVersion=2.0
/toolsversion:3.5
This does not build as the VB feature I use have been introduced in 4.0 tools.
So I changed toolsversion to 4.0 (and using MSBuild from .NET 4.0):
/p:TargetFrameworkVersion=2.0
/toolsversion:4.0
And now MSBuild complains about another thing:
C:\Users\Libor\AppData\Local\Temp\.NETFramework,Version=2.0.AssemblyAttributes.vb(6,24):
error BC30002: Type 'System.Runtime.Versioning.TargetFrameworkAttribute' is not defined.
[project.vbproj]
The only solution now for me is to open my project in VS 2008 and manually correct the code so it is compatible with all tools. But I hope MSBuild can be configured so it builds properly, as VS can build the project against .NET 2.0, too.
Similar question and answer here. They key is going to be:
msbuild YourSolution.sln /tv:4.0 /p:TargetFrameworkVersion=v2.0