Mark Jerde
12-06-2006, 04:20 AM
Using both VS 2005's 'Copy Web Site' and 'Publish Web Site', and MS's 'Web Deployment Project', I'm not able to get a web service with a DLL that works on my discountasp.net site. The site is set up to use .NET 2.0. The solution below works on my local machine but not at e.g.
www.sumdays.com/yyy/ws1/t1/service.asmx (http://www.sumdays.com/yyy/ws1/t1/service.asmx)
Any help will be greatly appreciated.
I started with a blank solution, testws1, and added a web service project and a class library project to subfolders. In the web service I got rid of the code-behind just to simplify things.
This is testws1 | ws1 | Service.asmx:
[quote]<%@WebServiceLanguage='C#'Class='Service'%>
usingSystem;
usingSystem.Web;
usingSystem.Web.Services;
usingSystem.Web.Services.Protocols;
usingClassLibrary1;
[WebService(Namespace='http://tempuri.org/')]
[WebServiceBinding(ConformsTo=WsiProfiles.BasicProf ile1_1)]
publicclassService:System.Web.Services.WebService
{
publicService(){
//Uncommentthefollowinglineifusingdesignedcomponents
//InitializeComponent();
}
[WebMethod]
publicstringHelloWorld(){
return'HelloWorld';
}
[WebMethod]
publicstringClassLibInfo(){
Class1c=newClass1();
returnc.Info();
}
}
</CODE>
This is testws1 | ClassLibrary1 | Class1.cs:
[quote]usingSystem;
usingSystem.Collections.Generic;
usingSystem.Text;
namespaceClassLibrary1{
publicclassClass1{
publicstringInfo(){
return'Himom.';
}
}
}</CODE>
Ctrl-F5 testing works fine, but every method I've tried to deploy to the host gives a page like this:
[quote]ServerErrorin'/'Application.
CompilationError
Description:Anerroroccurredduringthecompilationofa resourcerequiredtoservicethisrequest.Pleasereviewt hefollowingspecificerrordetailsandmodifyyoursource codeappropriately.
CompilerErrorMessage:CS0246:Thetypeornamespacename 'ClassLibrary1'couldnotbefound(areyoumissingausing directiveoranassemblyreference?)
SourceError:
Line5:usingSystem.Web.Services;
Line6:usingSystem.Web.Services.Protocols;
Line7:usingClassLibrary1;
Line8:
Line9:[WebService(Namespace='http://tempuri.org/')]
SourceFile:e:\web\sumdayscom0\htdocs\yyy\ws1\t1\Se rvice.asmxLine:7
CompilerWarningMessages:
Warning:CS1668:Invalidsearchpath'C:\ProgramFiles\S QLXML3.0\bin\'specifiedin'LIBenvironmentvariable'--'Accessisdenied.'
SourceError:
[Norelevantsourcelines]
Warning:CS1668:Invalidsearchpath'C:\ProgramFiles\S QLXML4.0\bin\'specifiedin'LIBenvironmentvariable'--'Accessisdenied.'
SourceError:
[Norelevantsourcelines]
ShowDetailedCompilerOutput:
c:\windows\system32\inetsrv>'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc .exe'/t:library/utf8output/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Service s\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dl l'/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Configurati on\2.0.0.0__b03f5f7f11d50a3a\System.Configuration. dll'/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0 __b77a5c561934e089\System.Xml.dll'/R:'C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__ b03f5f7f11d50a3a\System.Web.dll'/R:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\m scorlib.dll'/R:'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b7 7a5c561934e089\System.dll'/R:'C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0_ _b77a5c561934e089\System.Data.dll'/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\ 2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll'/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0 .0.0__b03f5f7f11d50a3a\System.Drawing.dll'/R:'C:\WINDOWS\assembly\GAC_32\System.EnterpriseSer vices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseS ervices.dll'/out:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 \TemporaryASP.NETFiles\root\98736c6f\3ef8a7cc\App_ Web_service.asmx.d3354eec.f9lj4w2l.dll'/debug-/optimize+/w:4/nowarn:1659;1699'C:\WINDOWS\Microsoft.NET\Framewor k\v2.0.50727\TemporaryASP.NETFiles\root\98736c6f\3 ef8a7cc\App_Web_service.asmx.d3354eec.f9lj4w2l.0.c s''C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\T emporaryASP.NETFiles\root\98736c6f\3ef8a7cc\App_We b_service.asmx.d3354eec.f9lj4w2l.1.cs'
Microsoft(R)VisualC#2005Compilerversion8.00.50727. 42
forMicrosoft(R)Windows(R)2005Frameworkversion2.0.5 0727
Copyright(C)MicrosoftCorporation2001-2005.Allrightsreserved.
warningCS1668:Invalidsearchpath'C:\ProgramFiles\SQ LXML3.0\bin\'specifiedin'LIBenvironmentvariable'--'Accessisdenied.'
warningCS1668:Invalidsearchpath'C:\ProgramFiles\SQ LXML4.0\bin\'specifiedin'LIBenvironmentvariable'--'Accessisdenied.'
e:\web\sumdayscom0\htdocs\yyy\ws1\t1\Service.asmx( 7,7):errorCS0246:Thetypeornamespacename'ClassLibra ry1'couldnotbefound(areyoumissingausingdirectiveor anassemblyreference?)
VersionInformation:Microsoft.NETFrameworkVersion:2 .0.50727.42;ASP.NETVersion:2.0.50727.210</CODE>
Thanks!
www.sumdays.com/yyy/ws1/t1/service.asmx (http://www.sumdays.com/yyy/ws1/t1/service.asmx)
Any help will be greatly appreciated.
I started with a blank solution, testws1, and added a web service project and a class library project to subfolders. In the web service I got rid of the code-behind just to simplify things.
This is testws1 | ws1 | Service.asmx:
[quote]<%@WebServiceLanguage='C#'Class='Service'%>
usingSystem;
usingSystem.Web;
usingSystem.Web.Services;
usingSystem.Web.Services.Protocols;
usingClassLibrary1;
[WebService(Namespace='http://tempuri.org/')]
[WebServiceBinding(ConformsTo=WsiProfiles.BasicProf ile1_1)]
publicclassService:System.Web.Services.WebService
{
publicService(){
//Uncommentthefollowinglineifusingdesignedcomponents
//InitializeComponent();
}
[WebMethod]
publicstringHelloWorld(){
return'HelloWorld';
}
[WebMethod]
publicstringClassLibInfo(){
Class1c=newClass1();
returnc.Info();
}
}
</CODE>
This is testws1 | ClassLibrary1 | Class1.cs:
[quote]usingSystem;
usingSystem.Collections.Generic;
usingSystem.Text;
namespaceClassLibrary1{
publicclassClass1{
publicstringInfo(){
return'Himom.';
}
}
}</CODE>
Ctrl-F5 testing works fine, but every method I've tried to deploy to the host gives a page like this:
[quote]ServerErrorin'/'Application.
CompilationError
Description:Anerroroccurredduringthecompilationofa resourcerequiredtoservicethisrequest.Pleasereviewt hefollowingspecificerrordetailsandmodifyyoursource codeappropriately.
CompilerErrorMessage:CS0246:Thetypeornamespacename 'ClassLibrary1'couldnotbefound(areyoumissingausing directiveoranassemblyreference?)
SourceError:
Line5:usingSystem.Web.Services;
Line6:usingSystem.Web.Services.Protocols;
Line7:usingClassLibrary1;
Line8:
Line9:[WebService(Namespace='http://tempuri.org/')]
SourceFile:e:\web\sumdayscom0\htdocs\yyy\ws1\t1\Se rvice.asmxLine:7
CompilerWarningMessages:
Warning:CS1668:Invalidsearchpath'C:\ProgramFiles\S QLXML3.0\bin\'specifiedin'LIBenvironmentvariable'--'Accessisdenied.'
SourceError:
[Norelevantsourcelines]
Warning:CS1668:Invalidsearchpath'C:\ProgramFiles\S QLXML4.0\bin\'specifiedin'LIBenvironmentvariable'--'Accessisdenied.'
SourceError:
[Norelevantsourcelines]
ShowDetailedCompilerOutput:
c:\windows\system32\inetsrv>'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc .exe'/t:library/utf8output/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Service s\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dl l'/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Configurati on\2.0.0.0__b03f5f7f11d50a3a\System.Configuration. dll'/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0 __b77a5c561934e089\System.Xml.dll'/R:'C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__ b03f5f7f11d50a3a\System.Web.dll'/R:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\m scorlib.dll'/R:'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b7 7a5c561934e089\System.dll'/R:'C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0_ _b77a5c561934e089\System.Data.dll'/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\ 2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll'/R:'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0 .0.0__b03f5f7f11d50a3a\System.Drawing.dll'/R:'C:\WINDOWS\assembly\GAC_32\System.EnterpriseSer vices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseS ervices.dll'/out:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 \TemporaryASP.NETFiles\root\98736c6f\3ef8a7cc\App_ Web_service.asmx.d3354eec.f9lj4w2l.dll'/debug-/optimize+/w:4/nowarn:1659;1699'C:\WINDOWS\Microsoft.NET\Framewor k\v2.0.50727\TemporaryASP.NETFiles\root\98736c6f\3 ef8a7cc\App_Web_service.asmx.d3354eec.f9lj4w2l.0.c s''C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\T emporaryASP.NETFiles\root\98736c6f\3ef8a7cc\App_We b_service.asmx.d3354eec.f9lj4w2l.1.cs'
Microsoft(R)VisualC#2005Compilerversion8.00.50727. 42
forMicrosoft(R)Windows(R)2005Frameworkversion2.0.5 0727
Copyright(C)MicrosoftCorporation2001-2005.Allrightsreserved.
warningCS1668:Invalidsearchpath'C:\ProgramFiles\SQ LXML3.0\bin\'specifiedin'LIBenvironmentvariable'--'Accessisdenied.'
warningCS1668:Invalidsearchpath'C:\ProgramFiles\SQ LXML4.0\bin\'specifiedin'LIBenvironmentvariable'--'Accessisdenied.'
e:\web\sumdayscom0\htdocs\yyy\ws1\t1\Service.asmx( 7,7):errorCS0246:Thetypeornamespacename'ClassLibra ry1'couldnotbefound(areyoumissingausingdirectiveor anassemblyreference?)
VersionInformation:Microsoft.NETFrameworkVersion:2 .0.50727.42;ASP.NETVersion:2.0.50727.210</CODE>
Thanks!