PDA

View Full Version : VS 2005 Deploy Web Service to Subfolder


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!

Mark Jerde
12-06-2006, 05:02 AM
I made the folder /yyy/ws1/t1 a web application, and it works now. Duh.

I tried several times earlier today but kept getting 'System Temporarily Unavailable'.
http://www.sumdays.com/images/SysTempUnavail.png

Do I need to do anything with web.config? Any good refs to web.config and web services in .NET 2.0?

Thanks.

bruce
12-07-2006, 12:35 PM
hmmm.. i can't really tell what's going on based on just the error. You'll should create a support ticket.

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

ironjeff
10-10-2008, 06:27 AM
Was this ever resolved? I'm hitting this with Visual Studio 2008 deploying a website.

ironjeff
10-13-2008, 05:42 AM
Thanks for the response! Here's the error from the page. I have all of the MVC dlls in my bin dir but it seems like they're not being used or referenced?

Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'FormMethod' does not exist in the current context

Source Error:

Line 23:
Line 24: <%= Html.ValidationSummary() %>
Line 25: <% using (Html.Form('Home', 'Default', FormMethod.Post)) { %>
Line 26: <table class='keyval'>
Line 27: <tr><th>Name</th><td><%= Html.TextBox('Name') %><%= Html.ValidationMessage('Name', '*') %></td></tr>


Source File: e:\web\whenshouldw\htdocs\Views\Home\Default.aspx Line: 25


Show Detailed Compiler Output:

c:\windows\system32\inetsrv> 'C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe' /t:library /utf8output /R:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\T emporary ASP.NET Files\root\720498f3\4172c53\assembly\dl3\ca01cec3\ de1bacd3_cc2cc901\System.Web.Mvc.DLL' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.IdentityMod el\3.0.0.0__b77a5c561934e089\System.IdentityModel. dll' /R:'C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0_ _b77a5c561934e089\System.Data.dll' /R:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\T emporary ASP.NET Files\root\720498f3\4172c53\App_Web_8-wbhney.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.Configurati on\2.0.0.0__b03f5f7f11d50a3a\System.Configuration. dll' /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.Runtime.Ser ialization\3.0.0.0__b77a5c561934e089\System.Runtim e.Serialization.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Routing \3.5.0.0__31bf3856ad364e35\System.Web.Routing.dll' /R:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\T emporary ASP.NET Files\root\720498f3\4172c53\assembly\dl3\709861c7\ 72ef30ac_c62cc901\Microsoft.Web.Mvc.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.WorkflowSer vices\3.5.0.0__31bf3856ad364e35\System.WorkflowSer vices.dll' /R:'C:\WINDOWS\assembly\GAC_32\System.EnterpriseSer vices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseS ervices.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\T emporary ASP.NET Files\root\720498f3\4172c53\assembly\dl3\7afb6b1e\ 10b4b6c7_c72cc901\PlannerData.DLL' /R:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\T emporary ASP.NET Files\root\720498f3\4172c53\assembly\dl3\b955dd2b\ 4a3daeb8_cb2cc901\PlannerFrontend.DLL' /R:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\T emporary ASP.NET Files\root\720498f3\4172c53\App_global.asax.or_w_f o5.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.Xml.Linq\3. 5.0.0__b77a5c561934e089\System.Xml.Linq.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Abstrac tions\3.5.0.0__31bf3856ad364e35\System.Web.Abstrac tions.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.ServiceMode l.Web\3.5.0.0__31bf3856ad364e35\System.ServiceMode l.Web.dll' /R:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\m scorlib.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensi ons\3.5.0.0__31bf3856ad364e35\System.Web.Extension s.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.ServiceMode l\3.0.0.0__b77a5c561934e089\System.ServiceModel.dl l' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.Data.DataSe tExtensions\3.5.0.0__b77a5c561934e089\System.Data. DataSetExtensions.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0. 0__b77a5c561934e089\System.Core.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0 .0.0__b03f5f7f11d50a3a\System.Drawing.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0 __b77a5c561934e089\System.Xml.dll' /R:'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b7 7a5c561934e089\System.dll' /out:'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 \Temporary ASP.NET Files\root\720498f3\4172c53\App_Web_p0wg4usg.dll' /D:DEBUG /debug+ /optimize- /win32res:'C:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\Temporary ASP.NET Files\root\720498f3\4172c53\p0wg4usg.res' /w:4 /nowarn:1659;1699;1701 /warnaserror- 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\root\720498f3\4172c53\App_Web_p0wg4usg.0.cs' 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET Files\root\720498f3\4172c53\App_Web_p0wg4usg.1.cs'


Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.

warning CS1668: Invalid search path 'C:\Program Files\SQLXML 3.0\bin\' specified in 'LIB environment variable' -- 'Access is denied. '
warning CS1668: Invalid search path 'C:\Program Files\SQLXML 4.0\bin\' specified in 'LIB environment variable' -- 'Access is denied. '
e:\web\whenshouldw\htdocs\Views\Home\Default.aspx( 25,55): error CS0103: The name 'FormMethod' does not exist in the current context

ironjeff
10-13-2008, 05:49 AM
Oh yeah I forgot to mention, the problem with the LIB environment variable still exists for me, but all I had to do was change my web.config to not treat warnings as errors and it continued. The new problem I have is what I just posted. :)

raymondp
10-13-2008, 11:40 AM
Do you have a link you can provide so we can see the complete error?

rcp
DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)