Skip to content

Further aspnet website build improvements#13087

Closed
johnazule wants to merge 4 commits into
dotnet:mainfrom
johnazule:main
Closed

Further aspnet website build improvements#13087
johnazule wants to merge 4 commits into
dotnet:mainfrom
johnazule:main

Conversation

@johnazule
Copy link
Copy Markdown
Contributor

Builds off #13058 and #12980 resolving #12980, by addressing other issues I encountered when trying to build a clean version of my solution. The biggest of these is that the RAR tasks in website metaprojects don't currently detect the web.config file and by extension the assembly redirects. Also the AspNetCompiler task's doesn't report error stack traces at the moment, which I believe is an easy when to add in. I am also skipping unchanged files when copying dependencies to the Bin folder to reduce double writes. I also have changed the generated metaproject to include properties that have been set using SetProperty on the metaproject instance. I know my filtering here is not complete and my tests will fail so leaving in draft until I have that resolved. The AspNetCompiler task generated in website metaprojects also doesn't provide the clean flag at the moment. I haven't found an elegant solution to pass this in at the moment, so I have hard coded it to be true. Welcome to feedback here but I needed it to be enabled in order to avoid a cheeky null reference error. Leaving in draft for now as I await the other PR's being merged and test resolution

Jeremy Spedding added 4 commits January 22, 2026 13:38
I am unsure if this has undesirable performace implications
…rrorstack to compiler errors and output floating properties to emitted metaproject file
Copy link
Copy Markdown
Member

@JanProvaznik JanProvaznik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaning towards this being a good idea to upstream, this issue pops up from time to time and this seems to fix it. Though I have some concerns with the implementation and need to discuss it a bit more internally.

project.ProjectName);
#else

if (File.Exists(Path.Combine(project.AbsolutePath, "web.config")))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this kind of project is compileable only on windows, right? and there the filenames are case insensitive, so there is no need to have them separate I suppose

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I'll cleanup

newTask.SetParameter("TargetPath", "$(" + GenerateSafePropertyName(project, "AspNetTargetPath") + ")");
newTask.SetParameter("Force", "$(" + GenerateSafePropertyName(project, "AspNetForce") + ")");
newTask.SetParameter("Updateable", "$(" + GenerateSafePropertyName(project, "AspNetUpdateable") + ")");
newTask.SetParameter("Clean", "true");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not seem right, perhaps it'd be OK to make a new AspNetClean property

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I'm at absolutely with you here, I'm just unsure if it should be set at the solution level or as an msbuild cli argument

Comment on lines -2401 to +2404
&& _sdkResolvedEnvironmentVariableProperties is not null
&& (!_sdkResolvedEnvironmentVariableProperties.Contains(property.Name) || !String.Equals(_sdkResolvedEnvironmentVariableProperties[property.Name].EvaluatedValue, property.EvaluatedValue, StringComparison.OrdinalIgnoreCase)))
&& (!Toolset.Properties.ContainsKey(property.Name) || !String.Equals(Toolset.Properties[property.Name].EvaluatedValue, property.EvaluatedValue, StringComparison.OrdinalIgnoreCase))
&& (_sdkResolvedEnvironmentVariableProperties is null
|| !_sdkResolvedEnvironmentVariableProperties.Contains(property.Name)
|| !String.Equals(_sdkResolvedEnvironmentVariableProperties[property.Name].EvaluatedValue, property.EvaluatedValue, StringComparison.OrdinalIgnoreCase)))
Copy link
Copy Markdown
Member

@JanProvaznik JanProvaznik Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got confused what happens here, but it's only a logically equivalent edit, right? (de morgan's theorem). I'd avoid changing it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically when the sdk resolved environment variable is null, we don't log out any properties to metaproject files, which I feel is confusing. This basically tries to only isolate the properties that aren't explicitly set. The problem I'm having with my implementation is that metaprojects are a copy of the solution metaproject (traversal project) which sets some properties that I'm unsure if they need to be cloned

/// <param name="commandLine">command line builder class to add arguments to</param>
protected internal override void AddCommandLineCommands(CommandLineBuilderExtension commandLine)
{
commandLine.AppendSwitch("-errorstack");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is reasonable to add for everyone. It would be confusing to users why the task is suddenly showing a lot more information. I could get behind putting it in the if (Debug){}

newTask.SetParameter("DelaySign", "$(" + GenerateSafePropertyName(project, "AspNetDelaySign") + ")");
newTask.SetParameter("AllowPartiallyTrustedCallers", "$(" + GenerateSafePropertyName(project, "AspNetAPTCA") + ")");
newTask.SetParameter("FixedNames", "$(" + GenerateSafePropertyName(project, "AspNetFixedNames") + ")");
newTask.SetParameter("Clean", "true");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set twice?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it's extra clean aha (I completely didn't realise, I'll commit a cleanup in a sec)

@JanProvaznik
Copy link
Copy Markdown
Member

After getting the netstandard issue merged the remaining thing here is -errorstack right? If you're interested in getting that in please rebase and reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants