Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6223271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:27:36+00:00 2026-05-24T08:27:36+00:00

Actually my objective is; Create asp.net web service (namespace ws, class Service1) Create dll

  • 0

Actually my objective is;

  1. Create asp.net web service (namespace ws, class Service1)
  2. Create dll from web service
  3. Install this dll to GAC
  4. Create ASP.NET web application
  5. Don’t add a reference for this dll in the GAC
  6. Create Web User Control without any code behind the file
  7. Write code inside the Web User Control to use the Web Service
    created above (without giving reference to application)

The question is;

  1. Can the web application searchs assembly inside GAC even if the
    assembly wasn’t referenced to the application
  2. Can I use this web
    user control(in this situation UC won’t be compiled because it isn’t
    code behinded) in other projects like WebParts?

PS: My last situation:
Service1.asmx.cs :

using System.Web.Services;

namespace ws
{
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    public class Service1 : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
    }
}

WebUserControl1.ascx :

<%@ Control Language="C#" ClassName="wuc" %>

<script runat="server">
    protected override void CreateChildControls()
    {
        base.CreateChildControls();
        ws.Service1 srv = new ws.Service1();
        btn.Text = srv.HelloWorld();

    }
</script>

<asp:Button runat="server" ID="btn" Text="asdasd" />

Default.aspx :

...
<%@ Register src="WebUserControl1.ascx" tagname="WebUserControl1" tagprefix="uc1" %>
...
    <form id="form1" runat="server">
    <div>    
        <uc1:WebUserControl1 ID="WebUserControl11" runat="server" />    
    </div>
    </form>
...

I compiled and web page came up with this error:
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:27:38+00:00Added an answer on May 24, 2026 at 8:27 am

    I have learnt and posted to my blog.

    First we need to generate dll from webservice:

    @SET WSDL="c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\wsdl.exe"
    %WSDL% /language:cs /out:c:\temp\servis.cs http://localhost:85/WebService1.asmx?WSDL
    

    We will deploy our webservice’s dll to GAC. So we need to have snk file. We will create dll file from our cs but before we need to create snk.

    @SET SN="c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\sn.exe"
    %SN% -k c:\temp\servis.snk
    

    Now we can generate dll from cs file

    @SET CSC="c:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe"
    %CSC% /target:library /out:c:\temp\servis.dll c:\temp\servis.cs /keyfile:C:\temp\servis.snk
    

    Now we can deploy this dll to GAC

    @SET GACUTIL="c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe"
    %GACUTIL% -if c:\temp\servis.dll
    

    We can learn FullName of our dll in the GAC

    %GACUTIL% /l servis.dll
    

    in .ascx file we can write these lines inside to script runat=server tag

    string sFullName = "servis, version=1.0.0.0 publickeytoken=asdhfasdfjk2323"
    string sClass = "Service1"
    object instance = Activator.CreateInstance(sFullName, sClass).Unwrap();
    Type tip = instance.GetType();
    MethodInfo mi = tip.GetMethod("HelloWorld");
    object result =  mi.Invoke(instance,null);
    string sResult = result.ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I decided to create a Vector Class for my app in strict objective-C. The
I need to create a web-service which invokes applescript which in turn starts photoshop,
Note: Although my particular context is Objective-C, my question actually transcends programming language choice.
Actually, this question seems to have two parts: How to implement pattern matching? How
Actually, I'm using this way. Do you have a better way? private bool AcceptJson(HttpRequest
Actually my question is all in the title. Anyway: I have a class and
My objective is create an apache module that will provide RESTful services (i.e., we
In several pieces of sample objective-c code I've seen people create new objects like
Apple doesn't want anyone to create iPhone apps outside of the Xcode/Objective-C environment. How
I am porting a plug-in from 32-bit to 64-bit which is actually in C++.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.