06. maj 2006 - 01:10Der er
27 kommentarer og 1 løsning
Visual Studio 2005 Express hjælp
Det er ikke så meget selv asp.net sprogt jeg lige nu har brug for at få hjælp til, men mere editoren. Og da jeg ikke kunne finde noget under kategorien "programmer" valgte jeg at oprette et spørgsmål her, da folk der programmere i asp.net må bruger det program.
Nå men mit problem er at jeg ikke lige kan få det til at virke, eller retter jeg forstår ikke hvad der sker.
Hvis jeg fx. opretter et nyt site, i VS2005, og vælger personal site, så kan jeg ikke se sitet.
Jeg får VS2005 til at create det på min webserver, med IIS m. .NET framework 1.1 installeret, i mappen hvor mit intranet ligger. Prøver jeg at tilgå siden får jeg en fejlside hvor overskriften er "Server Error in '/' Application.".
Prøver jeg er skrive stien til en fil fx. \\intranet\aspnettest\default.aspx så får jeg igen en fejlside med overskriften "Server Error in '/' Application.".
Server Error in '/' Application. --------------------------------------------------------------------------------
Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
Server Error in '/' Application. --------------------------------------------------------------------------------
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:
If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist. If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database. Sql Server Express must be installed on the machine. The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735043 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +820 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +68
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Ok... Du har så nok lavet en løsning der baserer sig på en lokal installation af sql server 2005 express. Hvis du fortsat vil benytte den - skal den være installeret på serveren også. Mvh
Nej - du skal installere sql server 2005 express på serveren, hvis det er sådan en du bruger (hvilket vil være tilfældet hvis du har f.eks. har lavet et login-system med de eksisterende login-kontroller etc). Mvh
Det kan du også sagtens - men så skal du skal du sørge for at asp.net databasen bliver lagt ind på den (kan du gøre med aspnet_regsql.exe der ligger i framework installationsfolderen), og så skal du sørge for at du konfigurerer din app til at benytte den (gør du ved ændringer i web.config). Mvh
aspnet_regsql.exe ligger (som standard) her: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe og skal blot eksekveres (du guides igennem af applikationen)
Du skal derefter konfigurere din applikation op til at benytte den istedet:
I web.config - lige over <system.web> sørger du for, at den connectionstring der er registreret som LocalSqlServer (som benyttes pr. default i forbindelse med de standard applikations services du kan benytte - som logon systemet) overskrives med en der passer til din "rigtige" sql server. (connectionstring kan du finde her : http://www.connectionstrings.com)
Angivelse af en anden connectionstring skriver du i sektionen connectionStrings i web.config (hvis der ikke er en i forvejen - indsætter du den lige over <system.web>):
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.