Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

asp.net 3.5 run get 500 server error, how get the app detail infos? #16

Closed
rainmakerho opened this issue Jan 6, 2017 · 13 comments
Closed

Comments

@rainmakerho
Copy link

rainmakerho commented Jan 6, 2017

@shhsu
i pull microsoft/aspnet:3.5 image , then build aspnetap image like below,

FROM microsoft/aspnet:3.5

RUN mkdir C:\aspnet35

RUN powershell -NoProfile -Command
Import-module IISAdministration;
New-IISSite -Name "ASPNET" -PhysicalPath C:\aspnet35 -BindingInformation "*:8000:"

EXPOSE 8000

ADD containerImageNet35/ /aspnet35

after image build and run.

i navigate asp.net page in browser, will get

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

may i get the app detail error messages?
thanks.

@shhsu
Copy link

shhsu commented Jan 6, 2017

Can you try adding this Dockerfile to containerImageNet35

FROM microsoft/aspnet:3.5
ARG site_root=.
ADD ${site_root} /inetpub/wwwroot

build

docker build -t mysite1 .

and then launch

docker run -d -p=80:80 mysite1

hit the default website

@rainmakerho
Copy link
Author

@shhsu
thank for your help.
default website run well.

my i change ${site_root} to my application folder,
like

FROM microsoft/aspnet:3.5

Next, this Dockerfile creates a directory for your application

RUN mkdir C:\aspnet35

ARG site_root=.
ADD ${site_root} C:\aspnet35

ADD net35/ /aspnet35

ps. net35 folder is my asp.net webforms application

thank.

@rainmakerho
Copy link
Author

@shhsu
i modify your docker file like below,

FROM microsoft/aspnet:3.5
ARG site_root=.
ADD ${site_root} /inetpub/wwwroot

ADD net35/ /inetpub/wwwroot

after run ,

i will get 500 error

There is a problem with the resource you are looking for, and it cannot be displayed.
may i get the app detail error messages?
thanks.

@rainmakerho
Copy link
Author

rainmakerho commented Jan 9, 2017

@shhsu
if i put my web.config will cause 500 error.
my web.config is vs.net 's default config.

if i don't copy web.config then it work well.

@rainmakerho
Copy link
Author

rainmakerho commented Jan 9, 2017

@shhsu
if my web.config contains
section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"

will cause 500 error.

should we remove configSections session from web.config ?

do you have any ideas ?

Thanks for your help.

@shhsu
Copy link

shhsu commented Jan 9, 2017

is your ${site_root} relative path?
absolute path would not work in docker file. I would that the files you add to the docker context be in the same folder or sibling to the docker file because the docker would include the entire directory you referred to the build context.

@rainmakerho
Copy link
Author

@shhsu
yes.
it will get 500 error, if web.config include configSections session.
should we remove configSections session from web.config ?
my config like web.config.txt.
Web.config.txt
thank for your help.

@shhsu
Copy link

shhsu commented Jan 10, 2017

Not sure what the problem could be.

To find the reason of 500 error, there are a few places you can look

  • Your applications log file directory
  • %SystemDrive%\Windows\System32\LogFiles\HTTPERR
  • %SystemDrive%\Windows\System32\winevt\logs

@rainmakerho
Copy link
Author

rainmakerho commented Jan 11, 2017

@shhsu
Thank for your help.
I have a question.
How can i copy container's files to host machine after docker run?
Thanks.
if web.config include configSections session below (default web.config), will cause server error.
<configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections>

@janvorli
Copy link
Member

@rainmakerho docker cp should do the trick.

@rainmakerho
Copy link
Author

@janvorli
Thank for your help.
I use docker cp , after docker run.
i have problem below,
docker cp f4:C:\inetpub\wwwroot .\mysite1

Error response from daemon: hcsshim::ActivateLayer failed in Win32: The process cannot access the file because it is being used by another process.
(0x20) id=f47aa0b21b9b9a43e3e01c9f82e3ea22c7f7a33998ac9f58544a2671684a2b24 flavour=1

@shhsu
Copy link

shhsu commented Jan 11, 2017

This error looks a little vague. It's hard to tell what the issue is. Do you know which IIS feature is required by your website? You might need to install them in your container.

We have something like this in our docker file for ASP.NET tests. Note that this is for .NET 45 but it might include some feature that you are missing. You can go over these features and see if any of these is what you need

RUN start /w dism /online /enable-feature /featurename:IIS-WebServerRole /featurename:WAS-WindowsActivationService /featurename:WAS-ProcessModel /featurename:NetFx4Extended-ASPNET45 /featurename:WAS-NetFxEnvironment /featurename:WAS-ConfigurationAPI /featurename:IIS-ApplicationDevelopment /featurename:IIS-NetFxExtensibility /featurename:NetFx3 /featurename:IIS-ASPNET /featurename:IIS-ASPNET45 /featurename:IIS-NetFxExtensibility /featurename:IIS-NetFxExtensibility45 /featurename:IIS-DefaultDocument /featurename:IIS-NetFxExtensibility /featurename:IIS-ISAPIExtensions /featurename:IIS-ISAPIFilter /featurename:IIS-RequestFiltering /featurename:IIS-Metabase /featurename:IIS-WMICompatibility /featurename:IIS-LegacyScripts /featurename:IIS-IIS6ManagementCompatibility /featurename:IIS-WebServerManagementTools /featurename:IIS-HttpTracing

@rainmakerho
Copy link
Author

@shhsu
ok. Thanks for you help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants