File tree 1 file changed +19
-1
lines changed
src/ServiceStack/WebHost.Endpoints/Support
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -85,13 +85,31 @@ public void Init()
85
85
}
86
86
87
87
EndpointHost . AfterInit ( ) ;
88
-
88
+ SetAppDomainData ( ) ;
89
+
89
90
var elapsed = DateTime . UtcNow - this . startTime ;
90
91
Log . InfoFormat ( "Initializing Application took {0}ms" , elapsed . TotalMilliseconds ) ;
91
92
}
92
93
93
94
public abstract void Configure ( Container container ) ;
94
95
96
+ public virtual void SetAppDomainData ( )
97
+ {
98
+ //Required for Mono to resolve VirtualPathUtility and Url.Content urls
99
+ var domain = Thread . GetDomain ( ) ; // or AppDomain.Current
100
+ domain . SetData ( ".appDomain" , "1" ) ;
101
+ domain . SetData ( ".appVPath" , "/" ) ;
102
+ domain . SetData ( ".appPath" , domain . BaseDirectory ) ;
103
+ if ( string . IsNullOrEmpty ( domain . GetData ( ".appId" ) as string ) )
104
+ {
105
+ domain . SetData ( ".appId" , "1" ) ;
106
+ }
107
+ if ( string . IsNullOrEmpty ( domain . GetData ( ".domainId" ) as string ) )
108
+ {
109
+ domain . SetData ( ".domainId" , "1" ) ;
110
+ }
111
+ }
112
+
95
113
/// <summary>
96
114
/// Starts the Web Service
97
115
/// </summary>
You can’t perform that action at this time.
0 commit comments