I'm quite inexperienced with .NET as a whole and would like a bit of guidance and pointing in the right
direction.
I'm developing a new website however, based on what I've read, I'm also using LINQ to SQL and Custom Server
Controls. The basic infrastructure is this:
I'm using SPROCS to do all CRUD operations.
I've got 2 projects, the first contains 2 LINQtoSQL files which encapsulate all my SPROCS. I use 2 LINQtoSQL files
because I'm using 2 different connections (strings) to connect to 2 different DB's. The second contains all my
custom server controls (which uses the LINQtoSQL project to access the DB.).
I then have a website which uses both these 2 projects.
I however am being lead down the path of not using LINQtoSQL because we don't know:
1. How to successfully deploy the website with these two projects (.dll's) which use LINQtoSQL.
2. It is intended that the website (using these two projects (.dll's) will be deployed to multiple (physical) servers. What will be the ramifications of this? Will this make deployment and maintenance more difficult? How would that be gone about?
If anyone can point me in the right direction, that'd be highly appreciated.
as long as proper .net framework deployed on server, no problems with LINQ you will have.. I don't really undrestand the second issue you describing, but if I got correctly you worried about several sites will use same DAL assembly to work with data. This
is also not a problem (moreover if different sites uses different DB intances.. in case of one intance, it depends on RDBMS.. I think that SQL2008 should handle this)).
I think I'm (once again) not exactly sure how to properly deploy to a server. I tried it the other day, just by:
1. copying all my local files onto the server
2. copying my local DB's onto the server and
3. changing the config file on the server to refer to itself.
This failed. I've tried googling how to properly deploy, however so far haven't found anything particularly definitive/helpful.
How would I go about deploying with the relevant .dll's? Do I just upload the .dll's to the server? Do I need to also register the .dll's on the server (using regserver32.exe)?
My second concern is that this website (and the associated .dll's) will be deployed on different servers in different countries around the world (which I'll have to maintain).
Will I have to rebuild the .dll's for each server specifically or will I be able to upload the same .dll's to each server and just change the config file to point to the appropriate machine (assuming all DB's etc... are the same)?
Similarly, if I change or add anything (new SPROCS etc...) will I only need to just upload the new .dll's (the same one) to each server or will I have to build specific ones for each server?
Will I need to register/re-register the .dll's after any changes?
If I understand the question clearly, you just need to change the connection string for LINQ to SQL when deploying. If the LINQ to SQL is a library project, you just need to create a new connection string with the same name in current web.config to override
the one in the DLL. Then, LINQ to SQL will automatically use the new one.
Thanks.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
I've been doing a bit of reading about deployment. Will the X-Copy method of deployment not work for this then? That is, just copying all the local files up onto the server and reconfiguring the web.config file (obviously with all the necessary DB's as
well). Is there some special requirement for deploying the .dll's? Do I necessarily need to build a deployment project? (I have no problem doing so if that's what's needed, I just don't know if that is what is needed).
No, the X-Copy deployment will also work for you and you have no need to have a deployment project. The only point you have to take care of is the connection string, you have to change it if needed when the project is deployed on server. Thanks.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
I've X-copied my code up onto the server. The site works ok when LINQtoSQL is not being used. So for example, I have a page that uses a data set to display rows in a grid view (using, incidentally the very same connection string as does LINQtoSQL) and
this works fine. However, as soon as I try to view a page that uses LINQtoSQL I get an error. I ran it from IE on the actual server and the error I get is:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
However, in light that the very same connection string (there is only one connection string in the web.config file) is used successfully by the data set to connect to the DB and display the correct data, then I'm struggling to see that there is a problem
with this connection string here. Any ideas as to what the problem could be?
Berris
Member
67 Points
41 Posts
Use and Deployment of LINQtoSQL
Sep 23, 2010 12:40 PM|LINK
Hi All;
I'm quite inexperienced with .NET as a whole and would like a bit of guidance and pointing in the right
direction.
I'm developing a new website however, based on what I've read, I'm also using LINQ to SQL and Custom Server
Controls. The basic infrastructure is this:
I'm using SPROCS to do all CRUD operations.
I've got 2 projects, the first contains 2 LINQtoSQL files which encapsulate all my SPROCS. I use 2 LINQtoSQL files
because I'm using 2 different connections (strings) to connect to 2 different DB's. The second contains all my
custom server controls (which uses the LINQtoSQL project to access the DB.).
I then have a website which uses both these 2 projects.
I however am being lead down the path of not using LINQtoSQL because we don't know:
1. How to successfully deploy the website with these two projects (.dll's) which use LINQtoSQL.
2. It is intended that the website (using these two projects (.dll's) will be deployed to multiple (physical) servers. What will be the ramifications of this? Will this make deployment and maintenance more difficult? How would that be gone about?
If anyone can point me in the right direction, that'd be highly appreciated.
AlexanderB
Participant
801 Points
163 Posts
Re: Use and Deployment of LINQtoSQL
Sep 23, 2010 01:03 PM|LINK
as long as proper .net framework deployed on server, no problems with LINQ you will have.. I don't really undrestand the second issue you describing, but if I got correctly you worried about several sites will use same DAL assembly to work with data. This is also not a problem (moreover if different sites uses different DB intances.. in case of one intance, it depends on RDBMS.. I think that SQL2008 should handle this)).
Just because it is interesting
Berris
Member
67 Points
41 Posts
Re: Use and Deployment of LINQtoSQL
Sep 23, 2010 02:21 PM|LINK
Hi AlexanderB;
Thanks for your response.
I think I'm (once again) not exactly sure how to properly deploy to a server. I tried it the other day, just by:
1. copying all my local files onto the server
2. copying my local DB's onto the server and
3. changing the config file on the server to refer to itself.
This failed. I've tried googling how to properly deploy, however so far haven't found anything particularly definitive/helpful.
How would I go about deploying with the relevant .dll's? Do I just upload the .dll's to the server? Do I need to also register the .dll's on the server (using regserver32.exe)?
My second concern is that this website (and the associated .dll's) will be deployed on different servers in different countries around the world (which I'll have to maintain).
Will I have to rebuild the .dll's for each server specifically or will I be able to upload the same .dll's to each server and just change the config file to point to the appropriate machine (assuming all DB's etc... are the same)?
Similarly, if I change or add anything (new SPROCS etc...) will I only need to just upload the new .dll's (the same one) to each server or will I have to build specific ones for each server?
Will I need to register/re-register the .dll's after any changes?
Many thanks...
Wencui Qian ...
All-Star
56784 Points
5796 Posts
Microsoft
Re: Use and Deployment of LINQtoSQL
Sep 28, 2010 07:34 AM|LINK
Hi Berris,
If I understand the question clearly, you just need to change the connection string for LINQ to SQL when deploying. If the LINQ to SQL is a library project, you just need to create a new connection string with the same name in current web.config to override the one in the DLL. Then, LINQ to SQL will automatically use the new one.
Thanks.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
AlexanderB
Participant
801 Points
163 Posts
Re: Use and Deployment of LINQtoSQL
Sep 29, 2010 06:56 AM|LINK
you should also check out, what micrsoft already offering for deployment:
http://blogs.msdn.com/b/webdevtools/archive/2009/02/04/web-deployment-with-vs-2010-and-iis.aspx
Just because it is interesting
Mohamed.Elkh...
Member
6 Points
3 Posts
Re: Use and Deployment of LINQtoSQL
Sep 29, 2010 08:19 AM|LINK
You will for sure need to change the connection string which have to be located on web.config file.
Also a suitable permission for that connection on the SQL server.
Mark this as an answer if you find it helpful.
Thanks
Egypt, Damietta
Technical Team Leader
Microsoft Certified Professional
http://mohamedelkhodary.blogspot.com/
Berris
Member
67 Points
41 Posts
Re: Use and Deployment of LINQtoSQL
Sep 29, 2010 08:43 AM|LINK
Hi All;
I've been doing a bit of reading about deployment. Will the X-Copy method of deployment not work for this then? That is, just copying all the local files up onto the server and reconfiguring the web.config file (obviously with all the necessary DB's as well). Is there some special requirement for deploying the .dll's? Do I necessarily need to build a deployment project? (I have no problem doing so if that's what's needed, I just don't know if that is what is needed).
Thanks...
Wencui Qian ...
All-Star
56784 Points
5796 Posts
Microsoft
Re: Use and Deployment of LINQtoSQL
Sep 30, 2010 07:57 AM|LINK
No, the X-Copy deployment will also work for you and you have no need to have a deployment project. The only point you have to take care of is the connection string, you have to change it if needed when the project is deployed on server. Thanks.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
Berris
Member
67 Points
41 Posts
Re: Use and Deployment of LINQtoSQL
Sep 30, 2010 08:48 AM|LINK
Many, many thanks for that guys. I will give that a whirl and if I have any problems, you'll be the first to know...
Thanks...
Berris
Member
67 Points
41 Posts
Re: Use and Deployment of LINQtoSQL
Oct 01, 2010 01:02 AM|LINK
Hi Guys;
I've X-copied my code up onto the server. The site works ok when LINQtoSQL is not being used. So for example, I have a page that uses a data set to display rows in a grid view (using, incidentally the very same connection string as does LINQtoSQL) and this works fine. However, as soon as I try to view a page that uses LINQtoSQL I get an error. I ran it from IE on the actual server and the error I get is:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
However, in light that the very same connection string (there is only one connection string in the web.config file) is used successfully by the data set to connect to the DB and display the correct data, then I'm struggling to see that there is a problem with this connection string here. Any ideas as to what the problem could be?
Thanks...