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

Deploy ASP.Net MVC using Web Deploy

$
0
0

I am trying to deploy an asp.net MVC  site to a remote IIS Server. The deployment work fine in Visual Studio but I want to automate it.

I am using the following MSDeploy Command:

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package="SportsStore.WebUI.csproj.zip" -dest:iisApp="Default Web Site/SSBuild",ComputerName="http://r2anet01.eastus.cloudapp.azure.com/MSDEPLOYAGENTSERVICE",UserName='Scott',Password='?????',AuthType='Basic' -allowUntrusted

MS deploy returns the following error:

Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to 'r2anet01.eastus.cloudapp.azure.com' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'r2anet01.eastus.cloudapp.azure.com'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error: The remote server returned an error: (401) Unauthorized.
Error count: 1.

I am using the same username/password in MSDeploy that I use in Visual Studio.

Any help would be appreciated.


IIS 8 Http Redirect will not take new port #?

$
0
0

For whatever reason I could not find mention of this anywhere on the internet ...

When you use the Http Redirect option for a Site Application, it does not seem to like it when you try to specify a destination URL that includes a port number, regardless of whether or not you select the "exact destination" option.

Does Http Redirect specifically not allow you to change the port number?  In which case is my next best option to add a redirect tag in web.config?

Thanks.  John

slowcheetah and app.config not working

$
0
0

Im using slowcheetah to transform my config files, in my mvc project it transforms web.config files as expected, but in my webjob projects (basically console apps) it wont work.  If I right click the app.config file I have no transform options available.  Anyone know why this could be ? my understanding is that it works for web.config and app.config files

Changes in web.config when .net framework is upgraded to 4.0 from 3.5

$
0
0

I have web application which was originally written in .net framework 3.5. I have changed .net framework to 4.0.

I noticed some changes in web.config file. 

Under 3.5 I had  <runtime /> section in web.config file. But when I changed to .net framework to 4.0, I can not see this section in web.config file.

<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/><bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/><bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly></assemblyBinding></runtime>            // This section not present in web.config under 4.0 framework.

I had under 3.5 framework,

<pages><controls><add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages>

But under 4.0 I have following,

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />

Wanted to know about these changes. Do I need to add <runtime /> section and change <pages /> section like 3.5 framework?

when i publish my project online than get this error plz find

$
0
0

error 

(Filename: \\?\C:\Inetpub\vhosts\solfrolic.com\httpdocs\web.config Line number: 20 Error: Config section 'system.web/compilation' already defined. Sections must only appear once per config file)

<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<!--<add name="DefaultConnection" connectionString="Data Source=ADMIN-PC\SQLEXPRESS;Initial Catalog=solsports;Integrated Security=True" providerName="System.Data.SqlClient" />-->
<add name="DefaultConnection" connectionString="Data Source=10.50.0.102;Integrated Security=False;User ID=sol;Connect Timeout=15;Encrypt=False;Packet Size=4096" providerName="System.Data.SqlClient" />
</connectionStrings>

<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
<authentication mode="None"/>
<compilation targetFramework="4.5" />

<httpRuntime targetFramework="4.5" />
<pages>
<namespaces>
<add namespace="System.Web.Optimization" />
<add namespace="Microsoft.AspNet.Identity" />
</namespaces>
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
</controls>
</pages>
<membership>
<providers>
<!--
ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
-->
<clear />
</providers>
</membership>
<profile>
<providers>
<!--
ASP.NET Membership Profile is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
-->
<clear />
</providers>
</profile>
<roleManager>
<!--
ASP.NET Membership Role is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
-->
<providers>
<clear />
</providers>
</roleManager>
<!--
If you are deploying to a cloud environment that has multiple web server instances,
you should change session state mode from "InProc" to "Custom". In addition,
change the connection string named "DefaultConnection" to connect to an instance
of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express.
-->
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
</providers>
</sessionState>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>

Getting error on Jenkins Build

$
0
0

I am using Jenkins on the first time it is successfully building but on later it getting error. UnderJenkins > WorkSpace > Application > PreCompiledWeb there are some files, from that files we are getting below error. Plz help me out to resolve this issue. 

Note : If we delete workspace folder and again build the application then it is successfully building....

error ASPPARSE: Could not load the assembly 'App_Web_uk1kln04'. Make sure that it is compiled before accessing the page.

How do i create the root of my ASP.NET landing page to my doman name

Configure a New Virtual Directory and map to a New App pool

$
0
0

I have a Web application and I want to run Mypage.aspx on a different App Pool from that of the application,here it was suggested that we need to create a virtual directory and map MyPage.aspx ,then I can assign a new app pool to virtual directory,kindly share any documentation to do the same(mean create virtual directory on IIS and mapping Appool).


Compare IP Address using File

$
0
0

Hi all,

i using ReadLines to search IPV4 address in file, but its not work as expected. need help from expert here. Below is my code.

Thanks

For Each line As String In File.ReadLines("D:\IP.txt")
If line.CompareTo(IP) Then

Response.Write(" Detect IP")
Else
Response.Write(" NOT Detect IP")

End If
Next line

Using web.config to force https + www without trailing slash.

$
0
0

Small problem I ran into trying to create rewrite rules to meet following requirements:

All incomming request should consist of "https://", "www" and should have no trailing slashes. I've tried a few possible solutions, but not one could meet up to all three requirements. Could anyone help me out here? What I have so far is:

<rules><clear/><rule name="Redirect to https://www" patternSyntax="ECMAScript" stopProcessing="true"><match url=".*"></match><conditions logicalGrouping="MatchAny"><add input="{HTTP_HOST}" pattern="^mydomain.be$"></add><add input="{HTTPS}" pattern="off"></add></conditions><action type="Redirect" url="https://www.mydomain.be/{R:0}" redirectType="Permanent"></action></rule><rule name="Remove trailing slash" stopProcessing="true"><match url="(.*)/$" /><conditions><add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /><add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /></conditions><action type="Redirect" redirectType="Permanent" url="https://www.mydomain.be/{R:1}" /></rule></rules>

But that doesn't seem to work for me...

context.Response.Write

$
0
0

First time when I execute the statement 

context.Response.Write(msg),it doesn't err.

Second time when we execute  context.Response.Write,it throws the below error,please suggest on how to fix it. 

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---&gt; Data at the root level is invalid. Line 1, position 1.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>

context.Response.Write(msg)

Custom Max Worker Thread

$
0
0

Hi all,

i want to control number of thread, request queue limit and etc.  i put this code in side my web.config.

<processModel
  requestQueueLimit="5000" restartQueueLimit="10"
  maxWorkerThreads="20" maxIoThreads="20" minWorkerThreads="1"
/>

and i put this code inside my .aspx file to read the value.

Dim configuration As System.Configuration.Configuration = WebConfigurationManager.OpenWebConfiguration("/aspnetTest")
Dim processModelSection As System.Web.Configuration.ProcessModelSection = CType(configuration.GetSection("system.web/processModel"), ProcessModelSection)
Response.Write("MAX Workwer :" + processModelSection.MaxWorkerThreads) 

finally i got this error :

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineOnly' beyond machine.config.

Source Error: 

Line 38:     <httpRuntime targetFramework="4.6"/>
Line 39:Line 40:   <processModel maxWorkerThreads="20" minWorkerThreads="1"/>
Line 41: Line

anyone here know why this happen. please help.

Default to e-mail address in health monitoring provider in root web.config

$
0
0

Howdy,

We're trying to find a way to have the health monitoring e-mails of all our applications be sent to one e-mail address, without having to specify that e-mail address in every application's web.config.  We were thinking this might be possible via the Root Web.config, which defaults values in application web.configs.

Example Application Web.Config:

<system.web>    <healthMonitoring enabled="true">      <providers>        <add name="FilteredMailWebEventProvider"             type="So.Esi.MvcFramework.Utility.HealthMonitoring.FilteredMailWebEventProvider"             buffer="true"             bufferMode="Notification"             maxMessagesPerNotification="10"             maxEventsPerMessage="10"             subjectPrefix="App Name"/>

Example Root Web.Config (our attempt):

<healthMonitoring>    
<
providers>      
<
add name="FilteredMailWebEventProvidertype="So.Esi.MvcFramework.Utility.HealthMonitoring.FilteredMailWebEventProviderto="one-email-to-rule-them-all@domain.edu" from="one-email-to-rule-them-all@domain.edu"/>   
</
providers>

Thanks in advance,

Andrew

modules and handlers not accepted in web.config in .net 4.7 and iis8.5

$
0
0

Hi all

I am migrating an existing asp.net website to asp.net framework version 4.7 and IIS version 8.5.
I cannot resolve a web.config file issue in the new system (it is a Plesk) without deleting desired handlers and modules. These handlers and modules are associated with asp.net charting and with Elmah error reporting.
The handlers and modules are included in two areas of web.config, <system.webServer> and <system.web>.


The code in web.config that I am forced to remove is:

<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<add name="Elmah.ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler"/>
<add name="Elmah.ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler"/>
</modules>
<handlers>
<remove name="ChartImageHandler" />
<add name="Elmah" path="Elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>


and

<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false" />
</httpHandlers>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>

</httpModules>
</system.web>

I cannot identify what is wrong. The above code is working fine in the older environment.
The log file on Plesk gives a 500 - Internal server error.

Even just adding
<modules> </modules>
<handlers> </handlers>
tags under <system.webServer> resulted in a 500 internal server error.

Any assistance would be very much appreciated. I am at my wits end!

Kind regards...Alan

Asp.net core app on ubuntu home server with Nginx

$
0
0

Hey, I recently managed to successfully deploy an  asp.net core app on my ubunt server followin this tutorial on the docs.

But i don't know how to host more than one app. as you see in the nginx config file it routes all request to port 80 to localhost:5000 which is what this first app uses.

but how do i host other apps and how can i access them?

this is the config file (as seen in the article):

server {
    listen 80;
    location / {
        proxy_pass http://localhost:5000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection keep-alive;
        proxy_set_header Host $http_host;
        proxy_cache_bypass $http_upgrade;
    }
}

It's not a big problem, because i can just use this app for everything and build it out. but i would rather build many apps because i want to learn.


redirect not working correctly on IE11

$
0
0

I deployed my project on iis. Part of web.config

<rule name="Angular" enabled="true" stopProcessing="true"><match url=".*" /><conditions logicalGrouping="MatchAll"><add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /><add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /></conditions><action type="Redirect" url="https://{HTTP_HOST}/advantageplus/?redirectTo={R:0}" /></rule>

All browsers are work fine.But page redirect to

https://{HTTP_HOST}/?redirectTo={R:0}'

in ie 11.The redirect ignores section of 'advantageplus' Any ideas?

Updating Class libraries (DLLs) for MVC app while website is running

$
0
0

Can I update class libraries (DLLs) that are part of my MVC application by simply copying them over to the server (overwriting the old copies of the DLL files that are changed) and restarting IIS/web service?  Or do I need to remove and re-deploy the site again on the server?

I am mainly updating existing code / controllers and adding some new ones as well (new functionality) to our existing website, which is an internal company Intranet site, so i'ts not critical if it's down for 5 minutes or so.

HTTP Request Queue

$
0
0

Hi all,

i'm using the following code to prevent the request queue reach it limit but the code is not work as i need.

The HTTP request queue limit is set to default (5000) and the code below is suppose to pop up a msg box because the HTTP request queue is below 3500.

Note: i'm using the msg box to see weather the code is work or not. 

Dim configuration As System.Configuration.Configuration = WebConfigurationManager.OpenWebConfiguration("/aspnetTest")
Dim processModelSection As System.Web.Configuration.ProcessModelSection = CType(configuration.GetSection("system.web/processModel"), ProcessModelSection)

processModelSection.RequestQueueLimit = 2900
If processModelSection.RequestQueueLimit <= 2900 Then
MsgBox("Info")
ElseIf processModelSection.RequestQueueLimit >= 3500 And processModelSection.RequestQueueLimit <= 3900 Then
MsgBox("Warning")
processModelSection.RequestQueueLimit = 4000
ElseIf processModelSection.RequestQueueLimit > 4000 And processModelSection.RequestQueueLimit <= 4500 Then
MsgBox("Error")

End If

Thanks wait for expert to replied.

Process metrics are available only when the ASP.NET process model is enabled

$
0
0

hi all,

i'm using the following code to get info about process model, however i getting errors follows: 

Process metrics are available only when the ASP.NET process model is enabled.  When running on versions of IIS 6 or newer in worker process isolation mode, this feature is not supported.

what else i can do to obtain the info, i'm using VS 2017 with IIS 10

Dim pi As ProcessInfo

pi = ProcessModelInfo.GetCurrentProcessInfo()

Response.Write("" & pi.PeakMemoryUsed.ToString)
Response.Write("" & pi.ProcessID.ToString)
Response.Write("" & pi.ProcessID.ToString)
Response.Write("" & pi.RequestCount.ToString)
Response.Write("" & pi.ShutdownReason.ToString)
Response.Write("" & pi.StartTime.ToString)
Response.Write("" & pi.Status.ToString)

Thanks.

bootstrap/jquery-or SOMETHING works fine locally, fails on QA server.

$
0
0

I have used a feature of Bootstrap (I think) where you can have tabbed notebooks.

I have it working on my desktop, but on Publish to the QA server NONE of the tabbed notebooks are working.  

From looking in the error logs, the site is not giving any 404's (like some javascript is  not installed), in fact there are no bad items in the IIS logs at all.

Same browser and everything else, but why is it failing in QA?  Where do I even start looking?

Viewing all 3561 articles
Browse latest View live


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