Quantcast
Channel: Configuration and Deployment
Viewing all 3561 articles
Browse latest View live

targetFramework exception

$
0
0
We have an asp.net website application that gives an error when we try to run it on an IIS6 server but does not give that same error on IIS7 or IIS8 server. The error message is listed below and the web application is assigned to asp.net 4.0 app pool. I'm not sure what the "provider options" are the message refers to. Thanks. Exception message: The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the <compilation> element of the Web.config file.

Website takes long time to load on Win2K, .NET 1.0

$
0
0

Hi All,

I just took over a website that was developed in C#, .NET 1.0, running on Windows 2000 SP4, using IIS 5.0.
I noticed the website was in debug mode, so I turned that off, but was wondering is there anything else I can do, to get better performance when my users first connect?

IIS 5.0 looks like the following...
http://tinyurl.com/myqcz7z

My WebConfig File looks like the following...
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation defaultLanguage="c#" debug="false"/>
<customErrors mode="Off"/>
<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible modes are "Windows", "Forms", thr "Passport" and "None" -->
<authentication mode="Windows"/>
<identity impersonate="false"/>
<pages validateRequest="false"/>
<trace enabled="true" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" fakepassword="false" timeout="45"/>
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
<httpRuntime maxRequestLength="131072"/>
</system.web>
</configuration>

Thanks

Server Error in '/' Application.

$
0
0

Full Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLayer;
using Models;

namespace TMOyeTrivia.ACOyetrivia
{
    public partial class EmpDetails : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid gdEmpId = Guid.Empty;
              if (!IsPostBack)
            {
                gdEmpId = new Guid(Request.QueryString[Constants.QRY_EmpId].ToString());
                hlnkEdit.NavigateUrl = "~/CheckMaster/EmpEntry.aspx?" + Constants.QRY_EmpId + "=" + gdEmpId + "&mode=edit";
                EmpOperation oEmpOperation = new EmpOperation();
                EmpInfo oEmpInfo = oEmpOperation.GetACEmpDetails(gdEmpId);
                EmpControls(oEmpInfo);

            }

        }
        private void EmpControls(EmpInfo paramEmployee)
        {
            if (paramEmployee.IsActive == true)
            {
                litIsActive.Text = "Active";
            }
            litEmpName.Text = paramEmployee.EmpName;
            litEmpTitle.Text = paramEmployee.EmpTitle;
            litCreatedDate.Text = Convert.ToString(paramEmployee.CreatedDate);
        }
    }
}
===========================================

the error is:

Object reference not set to an instance of an object.

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.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 28:             if (!IsPostBack)
Line 29:             {Line 30: gdEmpId = new Guid(Request.QueryString[Constants.QRY_EmpId].ToString()); 
Line 31: hlnkEdit.NavigateUrl = "~/CheckMaster/EmpEntry.aspx?" + Constants.QRY_EmpId + "=" + gdEmpId + "&mode=edit"; Line 32: EmpOperation oEmpOperation = new EmpOperation();


Now how to solve this error? How to handle null reference?

Webmatrix deployment using msbuild/msdeploy and assemblies

$
0
0

Hi,

When I make a new asp.net webpages 2 solution, the references are all there for me.  If I run msbuild and deploy, I noticed that some of my assemblies (system.web.helpers, etc) that are installed under (C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies) do not copy to the ~/bin.  So out of the 26 assemblies that my site needs, about 4 don't copy.  It looks like msbuild somehow automatically deciphers what is needed or note... 

Is there a way to include these refs?

Btw, a webmatrix website doesn't ahve a csproj file, but when i publish by VS, it makes me a website.csproj file.  I took advantage of this file and i'm wrong msbuild/deploy against that file.  

Issue in web config file

$
0
0

Hello

I have made a website in asp.net c# netframe 4.0 in Visual Studio 2012.

I have successfully deployed the website it is working 10000% fine, excelp default manage.aspx page in Account folder

I can login successfully on hosting server, I can access my database and all its infomration but when I goto ACCOUNT/Manager.aspx  page 

the error 

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

and 


Line 26:         {
Line 27:             // Determine the sections to renderLine 28: var hasLocalPassword = OpenAuth.HasLocalPassword(User.Identity.Name); Line 29:             setPassword.Visible = !hasLocalPassword;
Line 30:             changePassword.Visible = hasLocalPassword;
I know its web config issue my connection string is ok bcz i can login and access my data from the same database

this is what I am doing in web.config file 

<entityFramework><defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework"></defaultConnectionFactory></entityFramework>

Important
I am using Visual Studio 2012 and using Netframe 4.0 c#.

Unable to access the appsettings key if config section is present

$
0
0

Hi ,

I am having following config

<?xml version="1.0"?><configuration>
<appSettings><add key="IndexPath" value="" /><add key="APIUrl" value="http://www.google.com" /><add key="Interval" value="3" /><add key="ClientSettingsProvider.ServiceUri" value="" /></appSettings>
<configSections><section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" /></configSections><log4net><root><level value="DEBUG" /><appender-ref ref="LogFileAppender" /></root><appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"><param name="File" value="E:\log-file.txt" /><param name="AppendToFile" value="true" /><rollingStyle value="Size" /><maxSizeRollBackups value="10" /><maximumFileSize value="10MB" /><staticLogFileName value="true" /><layout type="log4net.Layout.PatternLayout"><param name="ConversionPattern" value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /></layout></appender></log4net>  <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup></configuration>
When I ma trying to access using ConfigurationManager.AppSettings["APIUrl"].ToString() then it is giving me error ,but if I remove the configsection and log4net section then it works perfect. Please provide me the solution to access appsettings key in the presence of log4net and configsection.
Thanks ,
Somnath

how to deploy my website in IIS7

$
0
0

Hi,

i have created a asp.net website. i need to host it in my local network and check it. Can anyone guide me in the steps in doing it. I am using windows7 and visual studio 2010..

Thanks in advance

Subdomain path relative to root application

$
0
0

I have an application with its subdomain in my website. This is my web.config rewrite rule:

<rule name="mubinaRule" stopProcessing="true"><match url="(.*)" /><conditions><add input="{HTTP_HOST}" pattern="^mubina.overflea.com$" /></conditions><action type="Rewrite" url="mubina/{R:1}" /></rule>


Since I did this, my paths are all messed up. For example, when I go to an Admin folder, for which you have to be logged in - it automatically redirects me to the login page. However, it does not redirect correctly: 

http://mubina.overflea.com/mubina/lgn53.aspx?ReturnUrl=%2fadmin%2f     is what I get redirected to, instead of 

http://mubina.overflea.com/lgn53.aspx?ReturnUrl=%2fadmin%2f

(notice the extra /mubina)

It is as though I am being redirected relative on the ROOT application, instead of the MUBINA application...

I am using this method 

http://blog.benpowell.co.uk/2010/02/winhostcom-how-to-really-run-multiple.html

I have also tried this method

<rule name="mub" enabled="true" stopProcessing="true"><match url="(.*)" /><conditions logicalGrouping="MatchAll" trackAllCaptures="false"><add input="{HTTP_HOST}" pattern="^(www\.)?mubina\.overflea\.com$" /><add input="{PATH_INFO}" pattern="^/overflea/($|/)" negate="true" /></conditions><action type="Rewrite" url="/mubina/{R:0}" /></rule>

But same thing occurs...


Encrypt web.config connectionstring

$
0
0

Hello!

I am trying to encrypt my connection string which contains the username and the password for my database in my hosting. I read a few articles online and i followed them but i am constantly getting this error:

Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: Bad Data.

Maybe there's something else that i should do before i copy my web.config to my hosting?

Does anyone have a step by step guide? 

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)

$
0
0

Hey there, 

was using VS 2012, and working on a web based project

I encountered the following error,

A connection was successfully established with the server,

but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)


When i checked an other application with the db, it worked fine, so definately there was no issue with the database.

Finally i got a Solution,

and the solution is toRemove .NET framework 4.5 and reinstall again.

Now thats how to solve it, but can anyone tell me what was the exact thing that created the issue!!!


Thanks in advance

Problems with Web.Config

$
0
0

Hi all

I have a ready website which i uploaded to my client's server(parallels)

and adjusted the following codes in web.config to make it to work

<customErrors mode="RemoteOnly"  defaultRedirect="Index.aspx"/>

Now it doesn't even show the errors that the pages show...It will auto redirect into Index.aspx..Is it possible to view the errors without removing the codes above?

Could not load file or assembly 'MyDll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=a348e42a78edea73' or one of its dependencies

$
0
0
Our web site is hosted in IIS with an AppPool set to run as a specific user account. When we directly refer to one of our managed assembly, no errors and the assembly is loaded ok. But the same assembly when referred to from the Mixed code (C++ code) throws the following exception Could not load file or assembly 'MyDll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=a348e42a78edea73' or one of its dependencies. The system cannot find the file specified. Fusion Details show === Pre-bind state information === LOG: User = NT AUTHORITY\NETWORK SERVICE LOG: DisplayName = CRC.XMLInterfaces, Version=0.0.0.0, Culture=neutral, PublicKeyToken=a348e42a78edea73 (Fully-specified) LOG: Appbase = file:///C:/Windows/SysWOW64/inetsrv/ LOG: Initial PrivatePath = NULL Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: No application configuration file found. LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: CRC.XMLInterfaces, Version=0.0.0.0, Culture=neutral, PublicKeyToken=a348e42a78edea73 LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/CRC.XMLInterfaces.DLL. LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/CRC.XMLInterfaces/CRC.XMLInterfaces.DLL. LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/CRC.XMLInterfaces.EXE. LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/CRC.XMLInterfaces/CRC.XMLInterfaces.EXE. Not sure why "AppBase" is set to inetsrv folder. Is there any way to force set the AppBase folder when loading from the mixed mode code. Same web site works perfectly fine on Windows Server 2008 R2. Problems started happening trying on Windows Server 2012. Thanks

setup connection string and database via application

$
0
0

I am developing an web application which need to install upon setting it first like that application will run the query and create relationship tables , proedures and other many things in that database. and create connection string which will be later used in interacting with that database.

means user will only enter server name and database name all tables and things should setup on when he click connect button in web application

how i can setup these things in my application.

How to solve warning: Consider app.config remapping of assembly

$
0
0

I got following warning when build my solution

Consider app.config remapping of assembly "WebGrease, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.0.0.0" [] to Version "1.3.0.0" [*\WebGrease.1.3.0\lib\WebGrease.dll] to solve conflict and get rid of warning.

I have followling line in web.config

<dependentAssembly><assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" /></dependentAssembly>



Can't export to file SQL RS in web application

$
0
0

We have an web application that uses reports in SQLRS 2012.

We can access the reports in the webapp using the reportviewer controls the problem is when we try to export we get and (401) Unauthorized error. But when you try to export directly from the SQLRS, it is ok.

We configured the webapp to use impersonate. It is impersonating a domain account.

Could be a temporary folder issue? Can you please help.

 

Thanks,

Chris


Subdomain rewrite causes AJAX to malfunction

$
0
0

After rewriting on my site using

<system.webServer><validation validateIntegratedModeConfiguration="false"/><modules runAllManagedModulesForAllRequests="true"/><rewrite><rules><clear /><rule name="Subdomain rewrite" stopProcessing="true"><match url=".*" /><conditions><add input="{HTTP_HOST}" pattern="^www\.overflea\.com$" negate="true" /><add input="{HTTP_HOST}" pattern="^([^\.]+)\.overflea\.com$" /></conditions><action type="Rewrite" url="/{C:1}{URL}" /></rule></rules></rewrite><urlCompression doStaticCompression="true" doDynamicCompression="true" /></system.webServer>

I started getting an error when trying to use AJAX:

soap:ReceiverSystem.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read() at System.Xml.XmlReader.MoveToContent() at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent() at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement() at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) --- End of inner exception stack trace ---

Anyone have any ideas? Apparently the "Data at the root level is invalid" error is caused by malformed XML files... but if I remove the rewrite rule, it works.

Trying to Publish first Web Form

$
0
0
I'm new to VS2012 and .net. I created a simple "Hello World" web form. I've read all sorts of posts and tutorials but they are lacking or mention things I'm not familar with. I have created the site, built it and click "Internet Explorer" in the menu bar and it displays correctly. I am trying to pubilsh this web form so that I can display it in my browser by typing in the URL. When I click Build > Publish WebApplication1, and get to the Connection Screen I enter my server name. Next you are supposed to enter the Site Name: Default Web Site/MyApp. My first question is what is MyApp? Is it my Solution name (Hello1), my Project name (WebApplication1) or WebForm1 which is what I entered when it asked me to name my Web Form? My second question is: What exactly is entered in the Destination URL? If I enter anything other than "http://localhost:61319/WebForm1.aspx" I get 403 or 404 errors. Shouldn't I just be able to enter http://localhost/WebForm1.aspx to display my webpage? Thanks in advanced for your help Chuck

Server Error in '/' Application.

$
0
0

1) EmpId

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.

Exception Details: System.IndexOutOfRangeException: EmpId

Source Error:

Line 23:           {
Line 24:               oEmpInfo = new EmpInfo();Line 25: oEmpInfo.EmpId = new Guid(rdrEmp[Constants.EmpId].ToString()); 
Line 26: oEmpInfo.EmpName=Convert.ToString(rdrEmp[Constants.EmpName]); Line 27: oEmpInfo.EmpTitle = Convert.ToString(rdrEmp[Constants.EmpTitle]);


2) Value cannot be null.
Parameter name: g

 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. 

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: g

Source Error:

Line 21:                 if (Request.QueryString[Constants.Mode] == Constants.EditMode)
Line 22:                 {Line 23: Guid gdEmpId=new Guid(Request.QueryString[Constants.EmpId]); 
Line 24: EmpOperation oEmpOperation = new EmpOperation(); Line 25: oEmpInfo = oEmpOperation.GetACEmpDetails(gdEmpId);

ASP.NET Web Site Administration Tool doesn't use indicated database

$
0
0

I use ASP.NET Web Site Administration Tool to create Roles and User. But it not use the Database that I indicated in web.config.

Here's the connnection string in web.config

<connectionStrings><add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-MvcApplication2-20130829213006;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-MvcApplication2-20130829213006.mdf" providerName="System.Data.SqlClient" /></connectionStrings>


I't use ASPNETDB.MDF instead of indicated database in web.config.

How to config this ?

IIS unable to display static file

$
0
0

hi all,

my website is running fine and untill recently i added a new image into the image directory. and it doesn't display to the client. when i press ctrl+f5 all the images are gone from the website. reliase that all the while i have been seeing the pic from local cache.

i have check the MIME type, i have added the .png, jpg, .gif correctly, i have added to allow=* for image directory in web.config.

when i type http://localhost/systemdir/images/logo.png in server it show the red X box and if in firefox it shows imagehttp://localhost/systemdir/images/logo.png  can not be display because it contains error.

however when i type c:\inetput\wwwroot\systemdir\images\logo.png in server it shows the image correctly.

i restarted the IIS, click all the features related to web in the features setting, set the MIME for that directory but it still not working

can any kind soul suggest what else can I do to solve this? had spent 8 hours on thisCry

Viewing all 3561 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>