Visual Studio
Windows、Web、モバイル デバイス用のアプリケーションを構築するための統合開発ツールの Microsoft スイートのファミリ。
55 件の質問
このブラウザーはサポートされなくなりました。
Microsoft Edge にアップグレードすると、最新の機能、セキュリティ更新プログラム、およびテクニカル サポートを利用できます。
VisualStudio Version 17.2.23まではVBフォームアプリでスタートアップオブジェクトをモジュールのMain()に指定できましたが、Version 17.3.0以降プロジェクトのプロパティメニューが変更になりモジュールのMain()をスタートアップオブジェクトに指定してもビルド時エラーになってしまいます。回避策はありますか?
.Net CoreのVBの起動設定まわりはいろいろ壊れてるので、手動で設定ファイルをいじります。
*.vbproj内のMyTypeをWindowsFormsWithCustomSubMainにして、アプリケーションフレームワークがMainを作らないように
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<MyType>WindowsForms</MyType>
<StartupObject>VBFormCoreX.My.MyApplication</StartupObject>
</PropertyGroup>
<PropertyGroup>
<!-- これになるように変更か上書き -->
<MyType>WindowsFormsWithCustomSubMain</MyType>
<StartupObject></StartupObject>
</PropertyGroup>
<?xml version="1.0" encoding="utf-16"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- アプリケーションフレームワークにチェックを入れたままにするなら、これをfalseに変更 -->
<MySubMain>false</MySubMain>
<MainForm>Form1</MainForm>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>