Mixing precompilled website with WCF services

  • Thread starter Thread starter Andrew Jocelyn
  • Start date Start date
A

Andrew Jocelyn

Hi

I'm using a web site deployment project, (not updateable) to deploy my
website application too an IIS 6 web server. I recently added some WCF
services, to a folder within the website. e.g.
https://host/services/service.svc.

I get a ServiceHost driective is missing error or
System.InvalidOperationException: Service 'myservice' has zero application
(non-infrastructure) endpoints.

How can I mix svc files with aspx pre-compiled (non-updateable) files using
a web deployment project and hosted as a single web application. This is
possible with asmx files.

thanks
Andrew
 
Hi Andrew,

Unfortunately it's a known issue that we're still working on.

For now you probably have three options:

" Publish the Web Site with "Allow this precompiled site to be updatable"
option turned on.

" Create Web Application project instead of Web Site project.

" Try Tom's suggestion as a workaround:
http://social.msdn.microsoft.com/forums/en-US/wcf/thread/8c897f8e-2143-450e-
a9f4-97d1f8702da7/

Please let me know if it works and feel free to ask if you have additional
questions.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Allen



I've found a fix for my application using Tom's suggestion. Just to
clarify - I am using a web application project and deploying using a web
deployment project as precompiled, non updateable. I then needed to change
the .compiled files in the bin folder so that the 'virtualPath',
'customString' and 'filedep name' matched the virtual path of the web site
from the application root.



Tom's suggestion is the most appropriate solution for me, I don't want the
app to be updateable. However for deployment I don't want to keep modifying
..compiled files every time I do a build. Is there anything I could add to
the web deployment project files to correctly modify the files during
deployment? I think this would help others too.



Thanks

Andrew
 
Hi Andrew,

Quote from Andrew ==================================================

Tom's suggestion is the most appropriate solution for me, I don't want the
app to be updateable. However for deployment I don't want to keep modifying
compiled files every time I do a build. Is there anything I could add to
the web deployment project files to correctly modify the files during
deployment? I think this would help others too.
==================================================


You can write a custom action for the web setup project.

How to write a custom action for web setup project:
http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx

In your scenario, you can find that .compiled file and edit it to change
the customString. Below is the code:

[RunInstaller(true)]
public partial class Installer1 : Installer
{
public Installer1()
{
InitializeComponent();
}

public override void Commit(IDictionary savedState)
{
string path = Context.Parameters["assemblypath"];
path = path.Substring(0, path.LastIndexOf(@"\"));
string filepath = path +
@"\bin\service.svc.cdcab7d2.compiled";//Please change the .compiled name
according to your scenario
string vpath = path.Split('\\').Last();
MessageBox.Show("File path is: " + filepath + ", Virtual Dir
is: " + vpath);

//Edit this file during installation.
string s = File.ReadAllText(filepath);
s = s.Replace(@"/WebSite6/Service.svc", @"/" + vpath+
@"/Service.svc");//Please change the name in your scenario
File.WriteAllText(filepath,s);
base.Commit(savedState);


}
}

The key here is to find out the virtual directory that user typed in the
previous step of the wizard. We can use Context.Parameters["assemblypath"]
to get the information.

Please have a try and let me know if it works for you. If you have further
questions please don't hesitate to let me know.

Regards,
Allen Chen
Microsoft Online Support
 
Hi Andrew,

Do you have any progress on this issue?

Regards,
Allen Chen
Microsoft Online Support
 
Back
Top