|
-
Jan 12th, 2011, 04:33 AM
#1
Thread Starter
Fanatic Member
[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.
-
Jan 12th, 2011, 09:40 PM
#2
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
-
Jan 13th, 2011, 12:13 AM
#3
Re: References
 Originally Posted by Webskater
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.
.
-
Jan 13th, 2011, 04:46 AM
#4
Thread Starter
Fanatic Member
Re: References
 Originally Posted by gep13
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.
-
Jan 13th, 2011, 09:57 PM
#5
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
-
Jan 20th, 2011, 09:26 AM
#6
Thread Starter
Fanatic Member
Re: References
 Originally Posted by gep13
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.
-
Jan 20th, 2011, 09:29 AM
#7
Thread Starter
Fanatic Member
Re: References
 Originally Posted by honeybee
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.
-
Jan 20th, 2011, 09:31 AM
#8
Thread Starter
Fanatic Member
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?
-
Jan 20th, 2011, 05:40 PM
#9
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
-
Jan 20th, 2011, 05:42 PM
#10
Re: References
 Originally Posted by Webskater
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
-
Jan 20th, 2011, 06:46 PM
#11
Thread Starter
Fanatic Member
Re: References
Thanks again for the replies.
-
Jan 21st, 2011, 07:51 AM
#12
Re: References
 Originally Posted by Webskater
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|