Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

MichaelSimons
Copy link
Member

@MichaelSimons MichaelSimons commented Feb 6, 2018

I've built preview images and published them at msimons/dotnet-framework-build for everyone to try out.

Copy link
Contributor

@shirhatti shirhatti left a comment

Choose a reason for hiding this comment

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

The only question I have is based on what came up in Monday's meeting on whether these Web.Targets are from the right project type. @Jinhuafei should probably have a look as well

@HongGit
Copy link
Contributor

HongGit commented Feb 8, 2018

Comment on the web targets files in the Zip package:

  • besides the web targets file, it also brings down the deploy targets. Are these files necessary as there is no WebDeploy in the current image?

I would vote for not adding these additional targets until we need them, thoughts?

@jmezach
Copy link

jmezach commented Apr 25, 2018

Any updates on this?

@amitsaha
Copy link

amitsaha commented May 9, 2018

Hi all, I am facing an issue with a ASP.NET Web API project where msbuild produces the /bin/Release/PublishOutput as per my publish profile when I am running it on the host (Windows 10 + VS 2017), but fails to do so when I run it in a container. Is this the same issue?
(For reference: this is my sample project)

@MichaelSimons
Copy link
Member Author

@amitsaha, yes this is more than likely your issue.
@jmezach, trying to get this merged now.

@jdivy
Copy link

jdivy commented May 10, 2018

Merge and publish? 💯

@ebh
Copy link

ebh commented May 15, 2018

Anything we can do to speed up the merging of this PR? It's blocking me and I don't want to build a workaround if this PR is about to be merged.

@richlander
Copy link
Member

FYI: We want to get this merged ASAP. We are working on the last steps now.

@dazinator
Copy link

Would it be ok to publish those targets as a nuget package?

@MichaelSimons
Copy link
Member Author

@dazinator - That is an option we are exploring. I think it would be generally useful.

@dazinator
Copy link

dazinator commented May 16, 2018

@dazinator
Copy link

dazinator commented May 16, 2018

I have tried these changes out for my legacy solution build and I am still getting this error:

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3009, 5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR2" and architecture "x86". Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\MSBuildTaskHost.exe" exists and can be run.
[18:34:43]C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3027, 7): error MSB4028: The "GenerateResource" task's outputs could not be retrieved from the "FilesWritten" parameter. Object does not match target type.
[18:34:43]foo\bar\baz.csproj: Build default targets (1s)

Does this PR not address this?

@MichaelSimons
Copy link
Member Author

@dazinator - Can you provide details on what you are trying? "legacy solution build" is too vague.

@dazinator
Copy link

dazinator commented May 16, 2018

@MichaelSimons - sure. So the error I am seeing looks to be first mentioned here: #101

In my case, I am taking an existing "team city build agent" docker image:

FROM jetbrains/teamcity-agent:latest-windowsservercore

I am then installing various tools and enabling various features (.NET 3.5 etc) so that it can build this .net 3.5 solution containing about 30 projects. I am happy to elaborate on what those steps are, if needed.

After applying your changes in this PR, all 29 projects in the solution are building except one project it seems.

[15:12:54]foo\bar\baz.csproj: Build default targets (1s)
[15:12:54]PrepareForBuild
[15:12:54]_GetProjectReferenceTargetFrameworkProperties
[15:12:54]ResolveProjectReferences
[15:12:54]_HandlePackageFileConflicts
[15:12:54]CoreResGen (1s)
[15:12:54]GenerateResource (1s)
[15:12:56]C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3009, 5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR2" and architecture "x86". Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\MSBuildTaskHost.exe" exists and can be run.
[15:12:56]C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(3027, 7): error MSB4028: The "GenerateResource" task's outputs could not be retrieved from the "FilesWritten" parameter. Object does not match target type.

I am guessing its because this particular project has embedded resources? (I will test this theory)

However if you look at the original issue I linked, there is a suggestion that this might be resolved as of this PR. So I am trying to work out what the cause of this problem is, and whether it has been fixed in any of the images anywhere..

@dazinator
Copy link

@MichaelSimons - Removing the RESX file from the problematic project allows it to build. So the problem looks specifically to occur when there are RESX files in these projects.

HongGit and others added 2 commits May 22, 2018 17:16
* adding web testing projects

* integrate web projects into ImageTests.cs

* update per feedback

* second update per code review feedbacks

* 3rd update per code review feedbacks

* 4th update per code review feedback

* hopefully last update for this PR
@MichaelSimons MichaelSimons changed the title [WIP] Add ASP.NET support to builder images Add ASP.NET support to builder images May 22, 2018
@MichaelSimons
Copy link
Member Author

@dazinator, Can you log a separate issue specific to the RESX issue you encountered?

@jmezach
Copy link

jmezach commented May 23, 2018

Will this also enable building WebDeploy packages by passing /p:DeployOnBuild=true to MSBuild?

@MichaelSimons
Copy link
Member Author

@jmezach - WebDeploy scenarios are not supported. Would appreciate it if you would log an issue enumerating the scenarios you would like to see supported.

@dazinator
Copy link

@MichaelSimons - Ok have opened #154 to track that resx issue.

@MichaelSimons MichaelSimons merged commit 2b8ab92 into master May 23, 2018
@MichaelSimons MichaelSimons deleted the aspnet-build branch May 23, 2018 19:22
@VishalMadhvani
Copy link

hey so now that this has been merged, is there much more left to do before it works?
I just tried to build the aspnetsample and it doesn't work.

@MichaelSimons
Copy link
Member Author

@VishalMadhvani - Can you share the cmd you executed and the results? Also what is the digest of the microsoft/dotnet-framework sdk image you are building with? Have you pulled the latest? e.g. docker build -t aspnetapp --pull .

@VishalMadhvani
Copy link

@MichaelSimons I hadn't pulled latest.. this now works. Many thanks

@rkmish
Copy link

rkmish commented May 23, 2024

@MichaelSimons , I am facing following issue - Project "C:\app\UBSIntegrator.csproj" on node 1 (default targets).
C:\app\UBSIntegrator.csproj(258,11): error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Also, tried to find "WebApplications\Microsoft.WebApplication.targets" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v17.0" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\MSBuild.exe.Config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths.
Done Building Project "C:\app\UBSIntegrator.csproj" (default targets) -- FAILED.

Following is the code inside docker file
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build
WORKDIR /app

copy csproj and restore as distinct layers

COPY *.csproj .

copy everything else and build app

COPY . .
#RUN nuget restore packages.config
RUN ls
WORKDIR /app
RUN msbuild UBSIntegrator.csproj /p:DeployOnBuild=true /p:PublishProfile=FolderProfile /p:Configuration=Release /p:VisualStudioVersion=17.0
#RUN msbuild /p:Configuration=Release -r:False

FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /app/. ./

Do Let me know what is the issue and how i can resolve it.
Thanks

@MichaelSimons
Copy link
Member Author

@rkmish - could you provide repro steps? That would help greatly in diagnosing. Also please open a new discussion topic for this question.

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.