CZEMacLeod / MSBuild.SDK.SystemWeb

This MSBuild SDK is designed to allow for the easy creation and use of SDK (shortform) projects targeting ASP.NET 4.x using System.Web.
MIT License
151 stars 8 forks source link

Provide `CommandLineArgsForDesignTimeEvaluation`? #47

Closed chucker closed 1 year ago

chucker commented 1 year ago

It seems this is an MSBuild property to speed up design-time evaluation.

And it seems this is now mandatory in Version 17.5.0 Preview 3.0. I get the following exception, and the project fails to fully initialize:

=====================
1/19/2023 11:44:21 AM
LimitedFunctionality
Microsoft.VisualStudio.LanguageServices.ProjectSystem.InvalidProjectDataException: Property 'CommandLineArgsForDesignTimeEvaluation' is required.
   at Microsoft.VisualStudio.LanguageServices.ProjectSystem.EvaluationData.GetRequiredPropertyValue(String name)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProjectFactory.<CreateProjectContextAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.LanguageServices.Workspace.<>c__DisplayClass39_0.<<OnEvaluationUpdateAsync>g__ProcessInitialEvaluationDataAsync|1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__Action|0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )

I'm not sure if this is a bug on MS's end, given that it's a preview, but maybe we should set this property regardless.

leusbj commented 1 year ago

I think you might be onto something regarding a "Preview Issue", and is potentially something already under review

One of the linked commits looks as if that property is being adjusted to nolonger be retrieved with a "GetRequiredPropertyValue" to instead use the "GetPropertyValue", so it might resolve itself in the next couple of preview releases

rahulvermapropertyme commented 1 year ago

This is now a problem in the latest GA release (v17.5)

CZEMacLeod commented 1 year ago

Looks like they never fixed 17.5. Either switch your install to 17.4.4 LTSC or use the 17.6.0P1.0 Preview editions...

https://github.com/dotnet/roslyn/pull/66367#issuecomment-1440720451

chucker commented 1 year ago

(See also #52)