Results 1 to 12 of 12

Thread: [RESOLVED] References

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Resolved [RESOLVED] References

    I've just realised I don't understand 'references'.

    Say you need to add a reference to the Crystal Reports Viewer. Where do you do the install?

    If you install the Business Objects Crystal Report Viewer on your development machine - and add a reference to the Viewer from your project - and then publish to a server - does the dll you are referencing get copied to the server too?

    Or should you install on the server? And reference it from your dev box? But what if you have a testing server and live server?

    Something that is confusing me is that on a development machine I was using until about a week ago, if I go to Start | All Programs there is Business Objects XI Release 2 | Crystal Reports | Crystal Reports X1 Release 2 available.

    If I add a reference to the Crystal Reports Viewer - a load of assemblys are added to the web config file. When I publish - it all works okay on the server(s) but, as far as I can see, nothing to do with Business Objects / Crystal Reports Viewer is installed on the server.

    If I add a reference to the Microsoft Word Interop thingy on my development machine - and publish it to a server - the server reports 'this reference does not exist on the server' (and I have to install Office on there to make it work on the server)

    So, what is difference between the reference to the Crystal Reports Viewer and Microsoft Word Interop?

    Hope this is clear and thanks for any help.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: References

    Hey,

    If you add a reference to an assembly in your project, if you look at the properties window for that reference, you will see that you have the option to copy that assembly to the output directory or not. This means that the assembly will either be copied to the debug/release folder or not. It might be the case that the assembly is already available on the server you are deploying to, i.e. in the GAC folder, so sometimes you don't need it copy it, but most times you do.

    I think the difference stems from the reference that you have added. Check the properties of each.

    Gary

  3. #3
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Re: References

    Quote Originally Posted by Webskater View Post
    So, what is difference between the reference to the Crystal Reports Viewer and Microsoft Word Interop?
    The Crystal Reports Viewer contains all the code necessary to display a crystal report. This is why, on deployment to a server, you don't have to install the whole Crystal Reports software on it. Imagine if you are in the business of publishing PDF files, you will only have to distribute the Acrobat Reader with your pdf files. You wouldn't have to distribute the whole Adobe software suite.

    Word Interop, on the other hand, is only a connector which allows your .Net code to interact with MS Word objects. These objects reside in the actual MS Word executable files. So if you want to deploy, you will have to deploy MS Office as well.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: References

    Quote Originally Posted by gep13 View Post
    Hey,

    If you add a reference to an assembly in your project, if you look at the properties window for that reference, you will see that you have the option to copy that assembly to the output directory or not. This means that the assembly will either be copied to the debug/release folder or not. It might be the case that the assembly is already available on the server you are deploying to, i.e. in the GAC folder, so sometimes you don't need it copy it, but most times you do.

    I think the difference stems from the reference that you have added. Check the properties of each.

    Gary
    Hi and thanks for your reply. How do you look at the property window for a reference? I have looked at 'Property Pages' which lists:

    References
    Build
    Accessibility
    Start Options
    MSBuild Options
    Silverlight Applications

    If I click on References it lists the References by Reference Name, Type and Version ... but I can't see how/where you can set the option to copy to the debug/release folder.

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: References

    Do you have the Properties Window open within the IDE?

    If so, simply select the reference in the Solution Explorer, and it's properties will appear in the Properties Window.

    Gary

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: References

    Quote Originally Posted by gep13 View Post
    Do you have the Properties Window open within the IDE?

    If so, simply select the reference in the Solution Explorer, and it's properties will appear in the Properties Window.

    Gary
    This is the bit I am stuck on. In the Solution Explorer in my web site project (not application) there are no 'References'. There is a 'Properties' icon at the top of the Solution Explorer. If you click this it opens the 'Property Pages' window I described above - which shows ...

    References
    Build
    Accessibility
    Start Options
    MSBuild Options
    Silverlight Applications

    If I click on References it lists the References by Reference Name, Type and Version ... but it doesn't allow you to set the option to copy to the debug/release folder.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: References

    Quote Originally Posted by honeybee View Post
    The Crystal Reports Viewer contains all the code necessary to display a crystal report. This is why, on deployment to a server, you don't have to install the whole Crystal Reports software on it. Imagine if you are in the business of publishing PDF files, you will only have to distribute the Acrobat Reader with your pdf files. You wouldn't have to distribute the whole Adobe software suite.

    .
    Thanks for your reply. As far as I can make out, the Crystal Report Viewer is no longer built in to Visual Studio - i.e. it isn't built in to VS2010.

    You have to download and install the viewer separately. I did this on my development box and the report viewer worked okay. I tried publishing to my UAT server and it fell over - couldn't find assemblies. So I downloaded the viewer on to the server and it worked. Seems a bit of a backward step to me.

    But, then again, I could be doing things wrong.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: References

    Another question on the same subject. I have a DataAccess namespace with various classes in it all to do with database access.

    I add this to every page ...

    using DataAccess;

    ... is there any way this can be added once somewhere so you don't have to remember to add it to every page?

  9. #9
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: References

    Ah, ok, looks like I was specifically talking about a Web Application template, not a web site template, which is what you are using.

    When you add a reference to a web site, it automatically goes into the projects bin folder, which means that it should be included in the "output" of the web site when you build it.

    Gary

  10. #10
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: References

    Quote Originally Posted by Webskater View Post
    Another question on the same subject. I have a DataAccess namespace with various classes in it all to do with database access.

    I add this to every page ...

    using DataAccess;

    ... is there any way this can be added once somewhere so you don't have to remember to add it to every page?
    Not really, no.

    You need to add this, as you are using it.

    If you really are using it on every page, you could look into editing the base class template file which Visual Studio uses when it creates a new class.

    Gary

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: References

    Thanks again for the replies.

  12. #12
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: References

    Quote Originally Posted by Webskater View Post
    Thanks again for the replies.
    Not a problem at all.

    Happy to help!

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width