]> OCCT Git - occt.git/commitdiff
0032986: Samples - csharp sample is crashed on compilation with VC++ 2022
authorddzama <ddzama@opencascade.com>
Fri, 19 Aug 2022 11:41:49 +0000 (14:41 +0300)
committersmoskvin <smoskvin@opencascade.com>
Tue, 6 Sep 2022 16:57:24 +0000 (19:57 +0300)
While demanding c++ language standard c++20, the error of OCCTProxy compilation is occured:

warning C4857: C++/CLI mode does not support C++ versions newer than C++17; setting language to /std:c++17
error C7681: two-phase name lookup is not supported for C++/CLI or C++/CX; use /Zc:twoPhase-

Officially, C++/CLI mode does not support C++ version newer than C++17, so we should not demand C++20 to compile csharp samples.
Alternative solution - using /permissive (ConformanceMode = false), rather than default value /permissive- (ConformanceMode = true)
option to compile OCCTProxy. But alternative solution has been denied.
So, here is nothing to do to fix compilation of OCCTProxy project.

Nevertheless, error occures in IE_WPF_WinForms and IE_WinForms - if we trying to compile with VC++ 2022 (not demanding c++20):

warning MSB3274: The primary reference "*\OCCTProxy.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.7.2" framework.
This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

To solve the problem it is proposed to demand by default the highest version of NETFramework - 4.8.
So, demanding NETFramework v4.8 does not crashing compilation of csharp samples with VC++ 2015.

samples/CSharp/WPF_D3D/IE_WPF_D3D.csproj
samples/CSharp/WPF_D3D/app.config
samples/CSharp/WPF_WinForms/IE_WPF_WinForms.csproj
samples/CSharp/WPF_WinForms/app.config
samples/CSharp/WinForms/IE_WinForms.csproj
samples/CSharp/WinForms/app.config

index 91cc3260ed318a28eb8a0297e8a6ea02750cae28..1e326d7b8b382a8d1ff186b5038eb44d7ece8433 100644 (file)
@@ -10,7 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>IE_WPF_D3D</RootNamespace>
     <AssemblyName>IE_WPF_D3D</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <WarningLevel>4</WarningLevel>
index e365603337787871e60524bd3a2ac7b2c1b0afb5..786a845b30bd4d3bc6c4e07b6ae82a5e718012c4 100644 (file)
@@ -1,3 +1,3 @@
 <?xml version="1.0"?>
 <configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
index 4996b0755b72bf0dc6d96ae890832d8ef5fd2ea7..a49e95f16430ae78fb99e8a1ee7792eb4e6ef686 100644 (file)
@@ -10,7 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>IE_WPF_WinForms</RootNamespace>
     <AssemblyName>IE_WPF_WinForms</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <WarningLevel>4</WarningLevel>
index e365603337787871e60524bd3a2ac7b2c1b0afb5..786a845b30bd4d3bc6c4e07b6ae82a5e718012c4 100644 (file)
@@ -1,3 +1,3 @@
 <?xml version="1.0"?>
 <configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
index 54b7b2aa39493aa54fe3e881f4ec57bc8246652a..7d232b571ae2e05e76198fcd71c06a1c4726391d 100644 (file)
@@ -27,7 +27,7 @@
     <UpgradeBackupLocation>
     </UpgradeBackupLocation>
     <OldToolsVersion>3.5</OldToolsVersion>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
     <TargetFrameworkProfile />
     <PublishUrl>publish\</PublishUrl>
     <Install>true</Install>
index cb021ce515447eae87ca8292dfa51f6b20ef5a31..a7c484feaad14cb6e74e50ad3ad3f3865516c4a0 100644 (file)
@@ -35,4 +35,4 @@
       </providers>
     </roleManager>
   </system.web>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>