@@ -204,40 +204,38 @@ protected override Task OnExecute (
204204 TargetFrameworkMoniker framework ,
205205 SolutionItemRunConfiguration runConfiguration )
206206 {
207+ var requiredVersion = DotNetCoreVersion . Parse ( Project . TargetFramework . Id . Version ) ;
207208 if ( DotNetCoreRuntime . IsMissing ) {
208- return ShowCannotExecuteDotNetCoreApplicationDialog ( ) ;
209+ return ShowCannotExecuteDotNetCoreApplicationDialog ( DotNetCoreRuntime . GetNotInstalledVersionMessage ( requiredVersion . OriginalString ) , requiredVersion ) ;
210+ }
211+ if ( Project . TargetFramework . IsNetCoreApp ( ) &&
212+ ! DotNetCoreRuntime . Versions . Any ( x => x . OriginalString . StartsWith ( Project . TargetFramework . Id . Version , StringComparison . OrdinalIgnoreCase ) ) ) {
213+ return ShowCannotExecuteDotNetCoreApplicationDialog ( DotNetCoreRuntime . GetNotInstalledVersionMessage ( requiredVersion . OriginalString ) , requiredVersion ) ;
209214 }
210215
211216 return base . OnExecute ( monitor , context , configuration , framework , runConfiguration ) ;
212217 }
213218
214- Task ShowCannotExecuteDotNetCoreApplicationDialog ( )
219+ Task ShowCannotExecuteDotNetCoreApplicationDialog ( string message , DotNetCoreVersion requiredVersion )
215220 {
216- return Runtime . RunInMainThread ( ( ) => {
217- CreateInfoBarInstance ( ) . Prompt ( ) ;
218- } ) ;
221+ return Runtime . RunInMainThread ( ( ) => CreateInfoBarInstance ( ) . Prompt ( message , requiredVersion ) ) ;
219222 }
220223
221- Task ShowDotNetCoreNotInstalledDialog ( bool unsupportedSdkVersion )
224+ Task ShowDotNetCoreNotInstalledDialog ( string message , DotNetCoreVersion requiredVersion )
222225 {
223226 return Runtime . RunInMainThread ( ( ) => {
224227 if ( ShownDotNetCoreSdkNotInstalledDialogForSolution ( ) )
225228 return ;
226229
227230 Project . ParentSolution . ExtendedProperties [ ShownDotNetCoreSdkInstalledExtendedPropertyName ] = "true" ;
228231
229- CreateInfoBarInstance ( unsupportedSdkVersion ) . Prompt ( ) ;
232+ CreateInfoBarInstance ( ) . Prompt ( message , requiredVersion ) ;
230233 } ) ;
231234 }
232235
233- DotNetCoreNotInstalledInfoBar CreateInfoBarInstance ( bool unsupportedSdkVersion = false )
236+ DotNetCoreNotInstalledInfoBar CreateInfoBarInstance ( )
234237 {
235- return new DotNetCoreNotInstalledInfoBar {
236- IsUnsupportedVersion = unsupportedSdkVersion ,
237- RequiredDotNetCoreVersion = DotNetCoreVersion . Parse ( Project . TargetFramework . Id . Version ) ,
238- CurrentDotNetCorePath = sdkPaths . MSBuildSDKsPath ,
239- IsNetStandard = Project . TargetFramework . Id . IsNetStandard ( )
240- } ;
238+ return new DotNetCoreNotInstalledInfoBar ( ) ;
241239 }
242240
243241 bool ShownDotNetCoreSdkNotInstalledDialogForSolution ( )
@@ -289,7 +287,8 @@ protected override void OnItemReady ()
289287 return ;
290288
291289 if ( HasSdk && ! IsDotNetCoreSdkInstalled ( ) ) {
292- ShowDotNetCoreNotInstalledDialog ( sdkPaths . IsUnsupportedSdkVersion ) ;
290+ var requiredVersion = DotNetCoreVersion . Parse ( Project . TargetFramework . Id . Version ) ;
291+ ShowDotNetCoreNotInstalledDialog ( DotNetCoreSdk . GetNotSupportedVersionMessage ( requiredVersion . OriginalString ) , requiredVersion ) ;
293292 }
294293
295294 if ( Project . ParentSolution == null )
0 commit comments