Saturday, March 31, 2012

VS2005/C#/ASP.NEt 2.0 error : "You must choose a publish location that is not a sub-folder

Hi over there,
I suddenly started to get the below error when I try to publish my websites,
in any of them !

I tried to google it but not much info.

Any help very much appreciated,

thanks in advance,

Genc Ymeri.
PS:
OS: 2003 server

PS:

--------
Microsoft Visual Studio
--------
You must choose a publish location that is not a sub-folder of the source
Web site.
--------
OK
--------as the message say, the dir you publish your site to must not be a subfolder
of the development site. under projet propeties, msbuild options, pick a new
directory.

-- bruce (sqlwork.com)

"genc_ymeri" <genc_ymeri@.hotmail.comwrote in message
news:nLmdnRm7UZNdw7fYnZ2dnUVZ_vKdnZ2d@.adelphia.com ...

Quote:

Originally Posted by

Hi over there,
I suddenly started to get the below error when I try to publish my
websites, in any of them !
>
I tried to google it but not much info.
>
Any help very much appreciated,
>
thanks in advance,
>
Genc Ymeri.
PS:
OS: 2003 server
>
PS:
>
--------
Microsoft Visual Studio
--------
You must choose a publish location that is not a sub-folder of the source
Web site.
--------
OK
--------
>
>


as the message say, the dir you publish your site to must not be a subfolder
of the development site...>

It's not ! I publish the projects in C:\Intepub\www\XXXX while the dev
directory is C:\Projects\VS2005\xxxxxx

"bruce barker (sqlwork.com)" <b_r_u_c_e_removeunderscores@.sqlwork.comwrote
in message news:%23ssppc76GHA.4568@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

as the message say, the dir you publish your site to must not be a
subfolder of the development site. under projet propeties, msbuild
options, pick a new directory.
>
-- bruce (sqlwork.com)
>
"genc_ymeri" <genc_ymeri@.hotmail.comwrote in message
news:nLmdnRm7UZNdw7fYnZ2dnUVZ_vKdnZ2d@.adelphia.com ...

Quote:

Originally Posted by

>Hi over there,
>I suddenly started to get the below error when I try to publish my
>websites, in any of them !
>>
>I tried to google it but not much info.
>>
>Any help very much appreciated,
>>
>thanks in advance,
>>
>Genc Ymeri.
>PS:
>OS: 2003 server
>>
>PS:
>>
>--------
>Microsoft Visual Studio
>--------
>You must choose a publish location that is not a sub-folder of the source
>Web site.
>--------
>OK
>--------
>>
>>


>
>

VS2005/IIS and Debugging a Web Application

I am trying to configure a web application named "mytestweb.com" and get the
error:

"Unable to start debugging on the web server. The web server is not
configured correctly. See help for common configuration errors. Running the
web page outside the debugger may provide further information."

When I try to navigate directly to
http://localhost/mytestweb.com/default.aspx, I receive a HTTP 403.1 error:
Execute Access Forbidden. "You have attempted to execute a CGI, ISAPI, or
other executable program from a directory that does not allow programs to be
executed."

I have verified that the virtual directory is created and has the same
permissions as another web application created the same way with one
exception: the one that works does NOT have an extension. It is simply
called "mytestweb".

I thought IE might be viewing this as an internet site, so I added
http://localhost as a trusted site - still the same problem, same error.

What do I need to do to be able to run and debug web applications with
extensions in the name?

Thanks!re:

Quote:

Originally Posted by

>I am trying to configure a web application named "mytestweb.com" and get the
error:


In general, it's not a good idea to have subwebs with somename.com in the name.
The server will think you are trying to run an executable file.

Try changing the name from :

Quote:

Originally Posted by

http://localhost/mytestweb.com/


to http://localhost/mytestweb/
It's OK if the dot-name is the domain name, i.e. :
http://mytestweb.com/ ( you'll need to have a registered domain for that to work )
but using application names which end in .com brings all sorts of problems with it.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Karch" <nospam@.absotutely.comwrote in message news:%23XBfaEY3GHA.4024@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>I am trying to configure a web application named "mytestweb.com" and get the
error:
>
"Unable to start debugging on the web server. The web server is not
configured correctly. See help for common configuration errors. Running the
web page outside the debugger may provide further information."
>
When I try to navigate directly to
http://localhost/mytestweb.com/default.aspx, I receive a HTTP 403.1 error:
Execute Access Forbidden. "You have attempted to execute a CGI, ISAPI, or
other executable program from a directory that does not allow programs to be
executed."
>
I have verified that the virtual directory is created and has the same
permissions as another web application created the same way with one
exception: the one that works does NOT have an extension. It is simply
called "mytestweb".
>
I thought IE might be viewing this as an internet site, so I added
http://localhost as a trusted site - still the same problem, same error.
>
What do I need to do to be able to run and debug web applications with
extensions in the name?
>
Thanks!
>
>


you probably need to check to properties in IIS to be sure that you are
pointing to the correct .Net Framework. You can specify 1.1 or 2.0 in the
properties of the web site.
--
Chris Davoli

"Karch" wrote:

Quote:

Originally Posted by

I am trying to configure a web application named "mytestweb.com" and get the
error:
>
"Unable to start debugging on the web server. The web server is not
configured correctly. See help for common configuration errors. Running the
web page outside the debugger may provide further information."
>
When I try to navigate directly to
http://localhost/mytestweb.com/default.aspx, I receive a HTTP 403.1 error:
Execute Access Forbidden. "You have attempted to execute a CGI, ISAPI, or
other executable program from a directory that does not allow programs to be
executed."
>
I have verified that the virtual directory is created and has the same
permissions as another web application created the same way with one
exception: the one that works does NOT have an extension. It is simply
called "mytestweb".
>
I thought IE might be viewing this as an internet site, so I added
http://localhost as a trusted site - still the same problem, same error.
>
What do I need to do to be able to run and debug web applications with
extensions in the name?
>
Thanks!
>
>
>

VS2005: Cannot run the website from IIS (database problem)

Hi,
I have developed a website from the model "Starter kits Classified". Well,
the application works good, no problem in my development environment. It
uses a SqlServer 2005 express database (using *.MDF files).
But, when i try to copy it to a IIS website, it dosent work.
- I created a website called "MyApp" under IIS (windows xp pro)
- I copied all the files from my "Visual Studio Express 2005 Web dev" to the
IIS/Default website/MyApp (files in c:\inetpub\wwwroot\MyApp)
- I setup ASP.NET config : ASPNET v2.0, default page = Default.aspx, Runtime
login = ASPNET (without admin rights), Windows integrated authentification
activated.
Results : the login page (login.aspx) works, but it doesnt connect.
It seems that the ASPNET user cannot connect to the Sql server database.
For me it's a mater of access rights to SqlServer 2005 from IIS.
Any ideas to help me please?
Thank you !As long as SQL Express is also installed on the machine, then you are
probably right that it is a access problem (I say that rather than access
rights as there is a prime reason for failure that is not "rights" based).
Check and make sure you have a protocol other than in memory (configuration
tool). That will cure most problems. In some instances, you also have to
turn on SQL Browser. That cures another group. In some instances, you will
also have to add users to SQL Server and give rights to the database, as
well.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com/
****************************************
*********
Think Outside the Box!
****************************************
*********
"TTT" <no@.no.no> wrote in message
news:4528ff57$0$17549$426a74cc@.news.free.fr...
> Hi,
> I have developed a website from the model "Starter kits Classified". Well,
> the application works good, no problem in my development environment. It
> uses a SqlServer 2005 express database (using *.MDF files).
> But, when i try to copy it to a IIS website, it dosent work.
> - I created a website called "MyApp" under IIS (windows xp pro)
> - I copied all the files from my "Visual Studio Express 2005 Web dev" to
> the IIS/Default website/MyApp (files in c:\inetpub\wwwroot\MyApp)
> - I setup ASP.NET config : ASPNET v2.0, default page = Default.aspx,
> Runtime login = ASPNET (without admin rights), Windows integrated
> authentification activated.
> Results : the login page (login.aspx) works, but it doesnt connect.
> It seems that the ASPNET user cannot connect to the Sql server database.
> For me it's a mater of access rights to SqlServer 2005 from IIS.
> Any ideas to help me please?
> Thank you !
>
> As long as SQL Express is also installed on the machine, then you are
> probably right that it is a access problem (I say that rather than access
> rights as there is a prime reason for failure that is not "rights" based).
> Check and make sure you have a protocol other than in memory
> (configuration tool). That will cure most problems.
I dit it

> In some instances, you also have to turn on SQL Browser. That cures
> another group.
I did it also..

> In some instances, you will also have to add users to SQL Server and give
> rights to the database, as well.
How to do it?

>

VS2005: ASP.net forms designer: Intellisense

I have created an inherited control based upon the GridView control, however
when I use this control within the VS2005 ASP.net form designer I can no
longer access the intellisense for the base control (technically it is now
in a new namespace instead of the original "asp").

I know I can create my own intellisense XML for the new properties that I
have added, but is there a way to tell VS that the other properties should
be taken from the asp:GridView or do I have to redo all properties within my
own XML?Hi,

Intellisense should work automatically if you just have the derived GirdView
and it's related objects (fields etc) in the same namespace. So if you have
derived from GridView, and have this subclass in your own namespace, for
Intellisense to work, you'd need to subclass also possible field classes
etc. and have them in this same namespace with the GridView

http://aspadvice.com/blogs/joteke/a...1/27/14886.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Martin Robins" <martin dot robins at technicaldirect dot co dot uk> wrote
in message news:eMaACCMVGHA.5588@.TK2MSFTNGP09.phx.gbl...
>I have created an inherited control based upon the GridView control,
>however when I use this control within the VS2005 ASP.net form designer I
>can no longer access the intellisense for the base control (technically it
>is now in a new namespace instead of the original "asp").
> I know I can create my own intellisense XML for the new properties that I
> have added, but is there a way to tell VS that the other properties should
> be taken from the asp:GridView or do I have to redo all properties within
> my own XML?

VS2005: Code "gramatically" correct..

Hi all,

Ok - I've used the word gramatically - which I'm sure is incorect, however I
mean when VS2005 lists "warnings" like this one:

Warning 1 Variable 'Command' is used before it has been assigned a value. A
null reference exception could result at runtime.
Warning 2 Variable 'Connection' is used before it has been assigned a value.
A null reference exception could result at runtime.
Warning 3 Variable 'Command' is used before it has been assigned a value. A
null reference exception could result at runtime.
Warning 4 Variable 'Connection' is used before it has been assigned a value.
A null reference exception could result at runtime.

Now, in my code I often do this within the "catch" part of a try..catch if
I've used a database connection/command in the "Try" section;

' tidy up
If Command Is Nothing <> False Then
Command.Dispose()
Command = Nothing
End If

If Connection Is Nothing <> False Then
Connection.Close()
Connection = Nothing
End If

The reason I do this, I believe is for tidyness, its quite possible that if
an exception was caused I may have already created my connection object,
and/or my Command object, therefore I test to see if they are "something",
and if so deal with them appropriately..

Of course, now with its new gadgets VS reports problems because I've not
"something'd" them in the "Catch" although I have in the "Try"...

Any suggestions - is my coding bad? Is there a better way? Any info
appreciated, I'm trying to go for good coding practices you see :o)

RobOne comment, is that when you are testing that the result of a boolean
expression is not equal to false - that is really confusing to read. A more
readable way is:

If Command Is Nothing = True Then

And, better yet:

If Command Is Nothing Then

Which is the most readable out of all of them.

Now, in all of the cases above, your If statement will execute, which is not
what you want, since you will get a nullreferenceexception.

Which proves my point as to just how confusing writing code like that is.

Now, the compiler can only do so much in figuring out your code. It may be,
that your code is written in such a way, that an object is always assigned
before you use it. If you want to get rid of the warning, always assign the
variable, even if it is to nothing.

And lastly, you do not need to set the variables to Nothing. That was
something you had to do in VB6.

"Rob Meade" <ten.bewdoowsgnik@.edaem.bbor> wrote in message
news:0avaf.229$Lw5.110@.text.news.blueyonder.co.uk. ..
> Hi all,
> Ok - I've used the word gramatically - which I'm sure is incorect, however
> I mean when VS2005 lists "warnings" like this one:
> Warning 1 Variable 'Command' is used before it has been assigned a value.
> A null reference exception could result at runtime.
> Warning 2 Variable 'Connection' is used before it has been assigned a
> value. A null reference exception could result at runtime.
> Warning 3 Variable 'Command' is used before it has been assigned a value.
> A null reference exception could result at runtime.
> Warning 4 Variable 'Connection' is used before it has been assigned a
> value. A null reference exception could result at runtime.
> Now, in my code I often do this within the "catch" part of a try..catch if
> I've used a database connection/command in the "Try" section;
> ' tidy up
> If Command Is Nothing <> False Then
> Command.Dispose()
> Command = Nothing
> End If
> If Connection Is Nothing <> False Then
> Connection.Close()
> Connection = Nothing
> End If
> The reason I do this, I believe is for tidyness, its quite possible that
> if an exception was caused I may have already created my connection
> object, and/or my Command object, therefore I test to see if they are
> "something", and if so deal with them appropriately..
> Of course, now with its new gadgets VS reports problems because I've not
> "something'd" them in the "Catch" although I have in the "Try"...
> Any suggestions - is my coding bad? Is there a better way? Any info
> appreciated, I'm trying to go for good coding practices you see :o)
> Rob
You have a few options:

1. You can ignore warnings which you are certain are not going to cause a
problem. Not a bad idea. After all, a warning is not a show-stopper, but it
does bring your attention to a potential problem.
2. You can turn off certain types of warnings in Tools|Options.
3. You can write code that the IDE prefers you to write. Not a bad idea.
There are good reasons why these warnings are raised, and adapting good
coding practices is always a help.
4. Some combination of the above which suits your specific personality
and/or needs.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"Rob Meade" <ten.bewdoowsgnik@.edaem.bbor> wrote in message
news:0avaf.229$Lw5.110@.text.news.blueyonder.co.uk. ..
> Hi all,
> Ok - I've used the word gramatically - which I'm sure is incorect, however
> I mean when VS2005 lists "warnings" like this one:
> Warning 1 Variable 'Command' is used before it has been assigned a value.
> A null reference exception could result at runtime.
> Warning 2 Variable 'Connection' is used before it has been assigned a
> value. A null reference exception could result at runtime.
> Warning 3 Variable 'Command' is used before it has been assigned a value.
> A null reference exception could result at runtime.
> Warning 4 Variable 'Connection' is used before it has been assigned a
> value. A null reference exception could result at runtime.
> Now, in my code I often do this within the "catch" part of a try..catch if
> I've used a database connection/command in the "Try" section;
> ' tidy up
> If Command Is Nothing <> False Then
> Command.Dispose()
> Command = Nothing
> End If
> If Connection Is Nothing <> False Then
> Connection.Close()
> Connection = Nothing
> End If
> The reason I do this, I believe is for tidyness, its quite possible that
> if an exception was caused I may have already created my connection
> object, and/or my Command object, therefore I test to see if they are
> "something", and if so deal with them appropriately..
> Of course, now with its new gadgets VS reports problems because I've not
> "something'd" them in the "Catch" although I have in the "Try"...
> Any suggestions - is my coding bad? Is there a better way? Any info
> appreciated, I'm trying to go for good coding practices you see :o)
> Rob
"Marina" wrote ...

> One comment, is that when you are testing that the result of a boolean
> expression is not equal to false - that is really confusing to read. A
> more readable way is:
> If Command Is Nothing = True Then
> And, better yet:
> If Command Is Nothing Then

Hi Marina,

I understand what you are saying, and thank you for the reply, however, in
my example:

If Command Is Nothing <> False Then
Command.Dispose()
Command = Nothing
End If

I would then have do add more code, ie,

If Command Is Nothing Then
' do nothing
Else
Command.Dispose
Command = Nothing
End If

Easier to read - but more code...

> Now, in all of the cases above, your If statement will execute, which is
> not what you want, since you will get a nullreferenceexception.

But this is why I'm testing it? Am I not saying in the test, if the object
is "something" then kill it off? ie, if its "nothing" (null?) then dont
worry...skip right past...

> Which proves my point as to just how confusing writing code like that is.

I'm obviously missing something, it makes sense to me - is what I've replied
with above here wrong then?

> Now, the compiler can only do so much in figuring out your code. It may
> be, that your code is written in such a way, that an object is always
> assigned before you use it. If you want to get rid of the warning, always
> assign the variable, even if it is to nothing.

The full chunk is as follows:

Public Function TruncateDatabase() As Boolean

' declare variables
Dim Connection As SqlConnection
Dim Command As SqlCommand
Dim Result As Boolean

' exception handling
Try

' create and open our database connection
Connection = New
SqlConnection(ConfigurationManager.AppSettings("Webmasters"))
Connection.Open()

' create and define our command object
Command = New SqlCommand
Command.Connection = Connection
Command.CommandType = CommandType.Text
Command.CommandText = "TRUNCATE TABLE Webmasters"

' execute
Command.ExecuteNonQuery()

' tidy up
Command.Dispose()
Command = Nothing
Connection.Close()
Connection = Nothing

' set result
Result = True

Catch ex As Exception

' TODO: Error handling

' tidy up
If Command Is Nothing <> False Then

Command.Dispose()
Command = Nothing

End If

If Connection Is Nothing <> False Then

Connection.Close()
Connection = Nothing

End If

' set flag
Result = False

End Try

' return result
Return Result

End Function

As per my initial post, I only actually set a value to those objects in the
"Try" block, hence the warning...as you suggested, setting them to nothing
at the top outside of Try would obviously clear these up.

> And lastly, you do not need to set the variables to Nothing. That was
> something you had to do in VB6.

I do that for completeness, I read/heard about .net clearing up after itself
as and when it deems appropriate, I just like to save it the trouble :)

Rob
"Kevin Spencer" wrote...

> 1. You can ignore warnings which you are certain are not going to cause a
> problem. Not a bad idea. After all, a warning is not a show-stopper, but
> it does bring your attention to a potential problem.

I love 'em - I think its one of my favourite things thus far between
2003/2005 - I've always been very task orientated, so for me this is dead
handy, oh look a long list of stuff to sort out :o)

> 2. You can turn off certain types of warnings in Tools|Options.

nah..

> 3. You can write code that the IDE prefers you to write. Not a bad idea.
> There are good reasons why these warnings are raised, and adapting good
> coding practices is always a help.

Sounds like a good idea.

> 4. Some combination of the above which suits your specific personality
> and/or needs.

3 for me I think :o)

Cheers Kevin,

Rob
re:
> I understand what you are saying, and thank you for the reply, however, in my example:
> If Command Is Nothing <> False Then
> Command.Dispose()
> Command = Nothing
> End If
> I would then have do add more code, ie,

Wouldn't :

If Command Then
Command.Dispose()
Command = Nothing
End If

work better ?

In C#, that works, too :

if (Command) {
Command.Dispose();
Command = null;
}

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Rob Meade" <ten.bewdoowsgnik@.edaem.bbor> wrote in message
news:BTvaf.269$Lw5.66@.text.news.blueyonder.co.uk.. .
> "Marina" wrote ...
>> One comment, is that when you are testing that the result of a boolean expression is
>> not equal to false - that is really confusing to read. A more readable way is:
>>
>> If Command Is Nothing = True Then
>>
>> And, better yet:
>>
>> If Command Is Nothing Then
> Hi Marina,
> I understand what you are saying, and thank you for the reply, however, in my example:
> If Command Is Nothing <> False Then
> Command.Dispose()
> Command = Nothing
> End If
> I would then have do add more code, ie,
> If Command Is Nothing Then
> ' do nothing
> Else
> Command.Dispose
> Command = Nothing
> End If
> Easier to read - but more code...
>> Now, in all of the cases above, your If statement will execute, which is not what you
>> want, since you will get a nullreferenceexception.
> But this is why I'm testing it? Am I not saying in the test, if the object is
> "something" then kill it off? ie, if its "nothing" (null?) then dont worry...skip right
> past...
>> Which proves my point as to just how confusing writing code like that is.
> I'm obviously missing something, it makes sense to me - is what I've replied with above
> here wrong then?
>> Now, the compiler can only do so much in figuring out your code. It may be, that your
>> code is written in such a way, that an object is always assigned before you use it. If
>> you want to get rid of the warning, always assign the variable, even if it is to
>> nothing.
> The full chunk is as follows:
> Public Function TruncateDatabase() As Boolean
> ' declare variables
> Dim Connection As SqlConnection
> Dim Command As SqlCommand
> Dim Result As Boolean
> ' exception handling
> Try
> ' create and open our database connection
> Connection = New SqlConnection(ConfigurationManager.AppSettings("Webmasters"))
> Connection.Open()
> ' create and define our command object
> Command = New SqlCommand
> Command.Connection = Connection
> Command.CommandType = CommandType.Text
> Command.CommandText = "TRUNCATE TABLE Webmasters"
> ' execute
> Command.ExecuteNonQuery()
> ' tidy up
> Command.Dispose()
> Command = Nothing
> Connection.Close()
> Connection = Nothing
> ' set result
> Result = True
> Catch ex As Exception
> ' TODO: Error handling
> ' tidy up
> If Command Is Nothing <> False Then
> Command.Dispose()
> Command = Nothing
> End If
> If Connection Is Nothing <> False Then
> Connection.Close()
> Connection = Nothing
> End If
> ' set flag
> Result = False
> End Try
> ' return result
> Return Result
> End Function
> As per my initial post, I only actually set a value to those objects in the "Try" block,
> hence the warning...as you suggested, setting them to nothing at the top outside of Try
> would obviously clear these up.
>> And lastly, you do not need to set the variables to Nothing. That was something you had
>> to do in VB6.
> I do that for completeness, I read/heard about .net clearing up after itself as and when
> it deems appropriate, I just like to save it the trouble :)
> Rob
The same for Connection, btw :

If Connection Then
Connection.Close()
Connection = Nothing
End If

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:OdQOG1M4FHA.2352@.TK2MSFTNGP12.phx.gbl...
> re:
>> I understand what you are saying, and thank you for the reply, however, in my example:
>>
>> If Command Is Nothing <> False Then
>> Command.Dispose()
>> Command = Nothing
>> End If
>>
>> I would then have do add more code, ie,
> Wouldn't :
> If Command Then
> Command.Dispose()
> Command = Nothing
> End If
> work better ?
> In C#, that works, too :
> if (Command) {
> Command.Dispose();
> Command = null;
> }
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Rob Meade" <ten.bewdoowsgnik@.edaem.bbor> wrote in message
> news:BTvaf.269$Lw5.66@.text.news.blueyonder.co.uk.. .
>> "Marina" wrote ...
>>
>>> One comment, is that when you are testing that the result of a boolean expression is
>>> not equal to false - that is really confusing to read. A more readable way is:
>>>
>>> If Command Is Nothing = True Then
>>>
>>> And, better yet:
>>>
>>> If Command Is Nothing Then
>>
>> Hi Marina,
>>
>> I understand what you are saying, and thank you for the reply, however, in my example:
>>
>> If Command Is Nothing <> False Then
>> Command.Dispose()
>> Command = Nothing
>> End If
>>
>> I would then have do add more code, ie,
>>
>> If Command Is Nothing Then
>> ' do nothing
>> Else
>> Command.Dispose
>> Command = Nothing
>> End If
>>
>> Easier to read - but more code...
>>
>>> Now, in all of the cases above, your If statement will execute, which is not what you
>>> want, since you will get a nullreferenceexception.
>>
>> But this is why I'm testing it? Am I not saying in the test, if the object is
>> "something" then kill it off? ie, if its "nothing" (null?) then dont worry...skip
>> right past...
>>
>>> Which proves my point as to just how confusing writing code like that is.
>>
>> I'm obviously missing something, it makes sense to me - is what I've replied with above
>> here wrong then?
>>
>>> Now, the compiler can only do so much in figuring out your code. It may be, that your
>>> code is written in such a way, that an object is always assigned before you use it.
>>> If you want to get rid of the warning, always assign the variable, even if it is to
>>> nothing.
>>
>> The full chunk is as follows:
>>
>> Public Function TruncateDatabase() As Boolean
>>
>> ' declare variables
>> Dim Connection As SqlConnection
>> Dim Command As SqlCommand
>> Dim Result As Boolean
>>
>> ' exception handling
>> Try
>>
>> ' create and open our database connection
>> Connection = New SqlConnection(ConfigurationManager.AppSettings("Webmasters"))
>> Connection.Open()
>>
>> ' create and define our command object
>> Command = New SqlCommand
>> Command.Connection = Connection
>> Command.CommandType = CommandType.Text
>> Command.CommandText = "TRUNCATE TABLE Webmasters"
>>
>> ' execute
>> Command.ExecuteNonQuery()
>>
>> ' tidy up
>> Command.Dispose()
>> Command = Nothing
>> Connection.Close()
>> Connection = Nothing
>>
>> ' set result
>> Result = True
>>
>> Catch ex As Exception
>>
>> ' TODO: Error handling
>>
>> ' tidy up
>> If Command Is Nothing <> False Then
>>
>> Command.Dispose()
>> Command = Nothing
>>
>> End If
>>
>> If Connection Is Nothing <> False Then
>>
>> Connection.Close()
>> Connection = Nothing
>>
>> End If
>>
>> ' set flag
>> Result = False
>>
>> End Try
>>
>> ' return result
>> Return Result
>>
>> End Function
>>
>> As per my initial post, I only actually set a value to those objects in the "Try"
>> block, hence the warning...as you suggested, setting them to nothing at the top outside
>> of Try would obviously clear these up.
>>
>>> And lastly, you do not need to set the variables to Nothing. That was something you
>>> had to do in VB6.
>>
>> I do that for completeness, I read/heard about .net clearing up after itself as and
>> when it deems appropriate, I just like to save it the trouble :)
>>
>> Rob
>>

VS2005: Cannot run the website from IIS (database problem)

Hi,

I have developed a website from the model "Starter kits Classified". Well,
the application works good, no problem in my development environment. It
uses a SqlServer 2005 express database (using *.MDF files).

But, when i try to copy it to a IIS website, it dosent work.
- I created a website called "MyApp" under IIS (windows xp pro)
- I copied all the files from my "Visual Studio Express 2005 Web dev" to the
IIS/Default website/MyApp (files in c:\inetpub\wwwroot\MyApp)
- I setup ASP.NET config : ASPNET v2.0, default page = Default.aspx, Runtime
login = ASPNET (without admin rights), Windows integrated authentification
activated.

Results : the login page (login.aspx) works, but it doesnt connect.
It seems that the ASPNET user cannot connect to the Sql server database.
For me it's a mater of access rights to SqlServer 2005 from IIS.

Any ideas to help me please?
Thank you !As long as SQL Express is also installed on the machine, then you are
probably right that it is a access problem (I say that rather than access
rights as there is a prime reason for failure that is not "rights" based).

Check and make sure you have a protocol other than in memory (configuration
tool). That will cure most problems. In some instances, you also have to
turn on SQL Browser. That cures another group. In some instances, you will
also have to add users to SQL Server and give rights to the database, as
well.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com/
*************************************************
Think Outside the Box!
*************************************************
"TTT" <no@.no.nowrote in message
news:4528ff57$0$17549$426a74cc@.news.free.fr...

Quote:

Originally Posted by

Hi,
>
I have developed a website from the model "Starter kits Classified". Well,
the application works good, no problem in my development environment. It
uses a SqlServer 2005 express database (using *.MDF files).
>
But, when i try to copy it to a IIS website, it dosent work.
- I created a website called "MyApp" under IIS (windows xp pro)
- I copied all the files from my "Visual Studio Express 2005 Web dev" to
the IIS/Default website/MyApp (files in c:\inetpub\wwwroot\MyApp)
- I setup ASP.NET config : ASPNET v2.0, default page = Default.aspx,
Runtime login = ASPNET (without admin rights), Windows integrated
authentification activated.
>
Results : the login page (login.aspx) works, but it doesnt connect.
It seems that the ASPNET user cannot connect to the Sql server database.
For me it's a mater of access rights to SqlServer 2005 from IIS.
>
Any ideas to help me please?
Thank you !
>


As long as SQL Express is also installed on the machine, then you are

Quote:

Originally Posted by

probably right that it is a access problem (I say that rather than access
rights as there is a prime reason for failure that is not "rights" based).
>
Check and make sure you have a protocol other than in memory
(configuration tool). That will cure most problems.


I dit it

Quote:

Originally Posted by

In some instances, you also have to turn on SQL Browser. That cures
another group.


I did it also..

Quote:

Originally Posted by

In some instances, you will also have to add users to SQL Server and give
rights to the database, as well.


How to do it?

Quote:

Originally Posted by

Quote:

Originally Posted by

>Hi,
>>
>I have developed a website from the model "Starter kits Classified".
>Well, the application works good, no problem in my development
>environment. It uses a SqlServer 2005 express database (using *.MDF
>files).
>>
>But, when i try to copy it to a IIS website, it dosent work.
>- I created a website called "MyApp" under IIS (windows xp pro)
>- I copied all the files from my "Visual Studio Express 2005 Web dev" to
>the IIS/Default website/MyApp (files in c:\inetpub\wwwroot\MyApp)
>- I setup ASP.NET config : ASPNET v2.0, default page = Default.aspx,
>Runtime login = ASPNET (without admin rights), Windows integrated
>authentification activated.
>>
>Results : the login page (login.aspx) works, but it doesnt connect.
>It seems that the ASPNET user cannot connect to the Sql server database.
>For me it's a mater of access rights to SqlServer 2005 from IIS.
>>
>Any ideas to help me please?
>Thank you !
>>


>
>

vs2005: domain trust relationship problem

Hi guys
I've got the following error on a project which is running locally on a
vs2005 machine (built in webserver), trying to connect to my win2k3 server
active directory.
the error is...
System.SystemException: The trust relationship between this workstation and
the primary domain failed.
How can I fix this? Also, my app is supposed to use integrated windows
authentication - how do I set this up on the vs2005 webserver thingy?!
Cheers
DanHi Dan,
From the error message, this seems a domain trust issue, is your webserver
hosting the asp.net web application in the domain other than the domain
you're going to access and retrieve info from? If so, are the two domain
establishing trust relation between each other? When accessing cross
domain's info such as performing windows authentication cross domain ,
there need trust relation between two domains ... You can try checking
this to see whether it is the case...
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
| Thread-Topic: vs2005: domain trust relationship problem
| thread-index: AcYXxO9Pl0NZ6Kb+T+KJhr9DjtZjtg==
| X-WBNR-Posting-Host: 172.203.227.195
| From: "examnotes" <musoswire@.community.nospam>
| Subject: vs2005: domain trust relationship problem
| Date: Thu, 12 Jan 2006 14:10:02 -0800
| Lines: 18
| Message-ID: <97D922B0-3178-4EF5-B773-B4F0AA6E6195@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:370467
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi guys
|
| I've got the following error on a project which is running locally on a
| vs2005 machine (built in webserver), trying to connect to my win2k3
server
| active directory.
|
| the error is...
|
| System.SystemException: The trust relationship between this workstation
and
| the primary domain failed.
|
| How can I fix this? Also, my app is supposed to use integrated windows
| authentication - how do I set this up on the vs2005 webserver thingy?!
|
| Cheers
|
|
| Dan
|
Hi Steven
Thanks for the reply...
I've actually got round this problem now by using managing to get UNC based
development working, so I don't need to do this now.
However, I'm only using one domain - the one that AD is set up with on my
Win2k3 server, one of the reasons I couldn't understand why I was getting th
e
error. Can you shed any light on why this didn't work? Be useful to know for
future reference :)
Cheers
Dan
"Steven Cheng[MSFT]" wrote:

> Hi Dan,
> From the error message, this seems a domain trust issue, is your webserver
> hosting the asp.net web application in the domain other than the domain
> you're going to access and retrieve info from? If so, are the two domain
> establishing trust relation between each other? When accessing cross
> domain's info such as performing windows authentication cross domain ,
> there need trust relation between two domains ... You can try checking
> this to see whether it is the case...
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> --
> | Thread-Topic: vs2005: domain trust relationship problem
> | thread-index: AcYXxO9Pl0NZ6Kb+T+KJhr9DjtZjtg==
> | X-WBNR-Posting-Host: 172.203.227.195
> | From: "examnotes" <musoswire@.community.nospam>
> | Subject: vs2005: domain trust relationship problem
> | Date: Thu, 12 Jan 2006 14:10:02 -0800
> | Lines: 18
> | Message-ID: <97D922B0-3178-4EF5-B773-B4F0AA6E6195@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA02.phx.gbl
> microsoft.public.dotnet.framework.aspnet:370467
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | Hi guys
> |
> | I've got the following error on a project which is running locally on a
> | vs2005 machine (built in webserver), trying to connect to my win2k3
> server
> | active directory.
> |
> | the error is...
> |
> | System.SystemException: The trust relationship between this workstation
> and
> | the primary domain failed.
> |
> | How can I fix this? Also, my app is supposed to use integrated windows
> | authentication - how do I set this up on the vs2005 webserver thingy?!
> |
> | Cheers
> |
> |
> | Dan
> |
>
It's hard to say Dan,
Can you reproduce behavior through some other security permission related
operations? e.g impersonate the client user and access some certain
resources on server which is granted access to only specific domain users?
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
| Thread-Topic: vs2005: domain trust relationship problem
| thread-index: AcYYL/KGu3aQ+vdwTmOlwFqvQnnymQ==
| X-WBNR-Posting-Host: 172.203.227.195
| From: "examnotes" <musoswire@.community.nospam>
| References: <97D922B0-3178-4EF5-B773-B4F0AA6E6195@.microsoft.com>
<NrWfmnCGGHA.1236@.TK2MSFTNGXA02.phx.gbl>
| Subject: RE: vs2005: domain trust relationship problem
| Date: Fri, 13 Jan 2006 02:56:03 -0800
| Lines: 87
| Message-ID: <61411B83-FDFE-4939-9DB3-7BDF8491F845@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:370584
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi Steven
|
| Thanks for the reply...
|
| I've actually got round this problem now by using managing to get UNC
based
| development working, so I don't need to do this now.
|
| However, I'm only using one domain - the one that AD is set up with on my
| Win2k3 server, one of the reasons I couldn't understand why I was getting
the
| error. Can you shed any light on why this didn't work? Be useful to know
for
| future reference :)
|
| Cheers
|
|
| Dan
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Dan,
| >
| > From the error message, this seems a domain trust issue, is your
webserver
| > hosting the asp.net web application in the domain other than the domain
| > you're going to access and retrieve info from? If so, are the two
domain
| > establishing trust relation between each other? When accessing cross
| > domain's info such as performing windows authentication cross domain ,
| > there need trust relation between two domains ... You can try checking
| > this to see whether it is the case...
| >
| > Regards,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --
| > | Thread-Topic: vs2005: domain trust relationship problem
| > | thread-index: AcYXxO9Pl0NZ6Kb+T+KJhr9DjtZjtg==
| > | X-WBNR-Posting-Host: 172.203.227.195
| > | From: "examnotes" <musoswire@.community.nospam>
| > | Subject: vs2005: domain trust relationship problem
| > | Date: Thu, 12 Jan 2006 14:10:02 -0800
| > | Lines: 18
| > | Message-ID: <97D922B0-3178-4EF5-B773-B4F0AA6E6195@.microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:370467
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Hi guys
| > |
| > | I've got the following error on a project which is running locally on
a
| > | vs2005 machine (built in webserver), trying to connect to my win2k3
| > server
| > | active directory.
| > |
| > | the error is...
| > |
| > | System.SystemException: The trust relationship between this
workstation
| > and
| > | the primary domain failed.
| > |
| > | How can I fix this? Also, my app is supposed to use integrated
windows
| > | authentication - how do I set this up on the vs2005 webserver thingy?!
| > |
| > | Cheers
| > |
| > |
| > | Dan
| > |
| >
| >
|