Skip to content

Commit

Permalink
fix: bug where the .dll filename was normalized when it shouldn't be …
Browse files Browse the repository at this point in the history
…in the Dockerfiles generated for Dot Net Core (#909)

Also add support for Dot Net Framework version 3.5

Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
  • Loading branch information
HarikrishnanBalagopal authored Nov 10, 2022
1 parent e1791cb commit 5bfb89b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ func (t *DotNetCoreDockerfileGenerator) TransformArtifact(newArtifact transforme
IncludeBuildStage: selectedBuildOption == dotnetutils.BUILD_IN_EVERY_IMAGE,
BuildStageImageTag: defaultDotNetCoreVersion,
BuildContainerName: imageToCopyFrom,
EntryPointPath: childProject.Name + ".dll",
EntryPointPath: childProject.OriginalName + ".dll",
RunStageImageTag: targetFrameworkVersion,
IncludeRunStage: true,
CopyFrom: common.GetUnixPath(copyFrom),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (t *WinConsoleAppDockerfileGenerator) DirectoryDetect(dir string) (map[stri
continue
}
targetFrameworkVersion := configuration.PropertyGroups[idx].TargetFrameworkVersion
if !dotnet.Version4.MatchString(targetFrameworkVersion) {
if !dotnet.Version4And3_5.MatchString(targetFrameworkVersion) {
logrus.Errorf("console dot net tranformer: the c sharp project file at path %s does not have a supported framework version. Actual version: %s", csProjPath, targetFrameworkVersion)
continue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (t *WinSilverLightWebAppDockerfileGenerator) DirectoryDetect(dir string) (m
continue
}
targetFrameworkVersion := configuration.PropertyGroups[idx].TargetFrameworkVersion
if !dotnet.Version4.MatchString(targetFrameworkVersion) {
if !dotnet.Version4And3_5.MatchString(targetFrameworkVersion) {
logrus.Errorf("silverlight dot net tranformer: the c sharp project file at path %s does not have a supported framework version. Actual version: %s", csProjPath, targetFrameworkVersion)
continue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (t *WinWebAppDockerfileGenerator) DirectoryDetect(dir string) (map[string][
continue
}
targetFrameworkVersion := configuration.PropertyGroups[idx].TargetFrameworkVersion
if !dotnet.Version4.MatchString(targetFrameworkVersion) {
if !dotnet.Version4And3_5.MatchString(targetFrameworkVersion) {
logrus.Errorf("the c sharp project file at path %s does not have a supported framework version. Actual version: %s", csProjPath, targetFrameworkVersion)
continue
}
Expand Down Expand Up @@ -175,7 +175,7 @@ func (t *WinWebAppDockerfileGenerator) DirectoryDetect(dir string) (map[string][
continue
}
targetFrameworkVersion := configuration.PropertyGroups[idx].TargetFrameworkVersion
if !dotnet.Version4.MatchString(targetFrameworkVersion) {
if !dotnet.Version4And3_5.MatchString(targetFrameworkVersion) {
logrus.Errorf("webapp dot net tranformer: the c sharp project file at path %s does not have a supported framework version. Actual version: %s", csProjPath, targetFrameworkVersion)
continue
}
Expand Down Expand Up @@ -306,7 +306,7 @@ func (t *WinWebAppDockerfileGenerator) Transform(newArtifacts []transformertypes

if selectedBuildOption == dotnetutils.BUILD_IN_BASE_IMAGE {
webConfig := WebTemplateConfig{
BuildStageImageTag: dotnet.DefaultBaseImageVersion,
BuildStageImageTag: t.getImageTagFromVersion(dotnet.DefaultBaseImageVersion),
IncludeBuildStage: true,
IncludeRunStage: false,
BuildContainerName: imageToCopyFrom,
Expand Down Expand Up @@ -378,7 +378,7 @@ func (t *WinWebAppDockerfileGenerator) Transform(newArtifacts []transformertypes

webConfig := WebTemplateConfig{
Ports: selectedPorts,
BuildStageImageTag: dotnet.DefaultBaseImageVersion,
BuildStageImageTag: t.getImageTagFromVersion(targetFrameworkVersion),
IncludeBuildStage: selectedBuildOption == dotnetutils.BUILD_IN_EVERY_IMAGE,
IncludeRunStage: true,
BuildContainerName: imageToCopyFrom,
Expand Down
4 changes: 2 additions & 2 deletions types/source/dotnet/csproj.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
)

var (
// Version4 is the framework version pattern
Version4 = regexp.MustCompile("v4")
// Version4And3_5 is the regex to match against specific Dot Net framework versions
Version4And3_5 = regexp.MustCompile(`(v4|v3\.5)`)
// WebLib is the key library used in web applications
WebLib = regexp.MustCompile(`^System\.Web`)
// AspNetWebLib is the key library used in asp net web applications
Expand Down

0 comments on commit 5bfb89b

Please sign in to comment.