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

How can i use a different web.config for QA or Dev environment ?

$
0
0

Hi ,

I have a web project and a main / default web.config , but I have different environment, a Debug, QA, Dev, Release. 

Now if I want to run on the Dev environment I need to manually copy the webDev.config as the web.config for the app, likewise if testing on QA.

Is there an automation process for this ?

I have looked at web transforms , but there are more than just connection string changes .

Any suggestions as to how I can do this ?

thanks


Error : "Copying file packages\Newtonsoft..." when publishing ASP.NET web app to IIS on Windows Server 2019

$
0
0

I copied my working ASP.NET web app from my old Windows Server 2012 R2 to my new Windows Server 2019 but now get this error when I try to publish it to localhost.

------ Build started: Project: ZZZ web, Configuration: Debug Any CPU ------
------ Publish started: Project: ZZZ web, Configuration: Debug Any CPU ------
Auto ConnectionString Transformed web.config into C:\Users\ME\AppData\Local\Temp\WebSitePublish\ZZZ web-1297686886\obj\Debug\CSAutoParameterize\transformed\web.config.
Copying all files to temporary location below for package/publish:
C:\Users\ME\AppData\Local\Temp\WebSitePublish\ZZZ web-1297686886\obj\Debug\Package\PackageTmp.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.targets(2601,5):


Error : Copying file packages\Newtonsoft.Json.6.0.4\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll to C:\Users\ME\AppData\Local\Temp\WebSitePublish\ZZZ web-1297686886\obj\Debug\Package\PackageTmp\packages\Newtonsoft.Json.6.0.4\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll failed.


Could not find a part of the path 'packages\Newtonsoft.Json.6.0.4\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll'.

oauth authentication

$
0
0

i have this code:

string[] scopes = new string[] { "https://www.googleapis.com/auth/contacts" }; // view your basic profile info.

// Use the current Google .net client library to get the Oauth2 stuff.
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = clientId, ClientSecret = clientSecret }
, scopes
, "teste"
, CancellationToken.None
, new FileDataStore(Server.MapPath("/") + "Datastore")).Result;

// Translate the Oauth permissions to something the old client libray can read
OAuth2Parameters parameters = new OAuth2Parameters();
parameters.AccessToken = credential.Token.AccessToken;
parameters.RefreshToken = credential.Token.RefreshToken;


RequestSettings settings = new RequestSettings("contacts-241813", parameters);
ContactsRequest cr = new ContactsRequest(settings);

if(User.Identity.IsAuthenticated)

CreateContact(cr);

---------------------------------------------

locally runs fine

when i deploy to IIS or hosting iis i get this error:

Line 92:             
Line 93:                 // Use the current Google .net client library to get the Oauth2 stuff.Line 94:                 UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = clientId, ClientSecret = clientSecret }Line 95:                                                                                              , scopes
Line 96:                                                                                              , "teste"


Source File: C:\Users\Nando\Desktop\Contacts\Contacts\Controllers\HomeController.cs    Line: 94 

Stack Trace: 

[Win32Exception (0x80004005): Access is denied]
   System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) +604
   System.Diagnostics.Process.Start(ProcessStartInfo startInfo) +60
   Google.Apis.Auth.OAuth2.<ReceiveCodeAsync>d__16.MoveNext() +258

[NotSupportedException: Failed to launch browser with "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&response_type=code&client_id=23969819486-75cvofc052k333h0sc3pee549slvr87k.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A64517%2Fauthorize%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcontacts" for authorization. See inner exception for details.]
   Google.Apis.Auth.OAuth2.<ReceiveCodeAsync>d__16.MoveNext() +832
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Google.Apis.Auth.OAuth2.<AuthorizeAsync>d__8.MoveNext() +701
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Google.Apis.Auth.OAuth2.<AuthorizeAsync>d__4.MoveNext() +572
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
   Google.Apis.Auth.OAuth2.<AuthorizeAsync>d__1.MoveNext() +426


i granted permission to folder Datastore in Server.Mappath

What can i do ?


Converting Project to WebApplication, How do I access regular HTML components?

$
0
0

Since creating a "Website" seems to be dead, and unsupported, but also because my website isn't far enough along to totally rule this out, I want to convert my project over to a WebApplication. Which I think I'm almost done.

Unfortunately I have over 500 errors, all of them being "does not exist in the current context".
This is because I do all my front end in BootstrapStudio, and not in visual studio, so I have regular HTML code.

In my my "Website" project, I was able to reference these regular HTML components, as long as they have "runat="server"" as an attribute, but apparently this is not supported with Web Application.


Main Question:

I really don't want to have to add "asp:" to every HTML component I want to use, every time I import my HTML from BSS, so is there anything I can do, to allow myself to access and edit these regular HTML components?



I suppose I could write a program that automatically add's these to every component with runat="server", but if I remember correctly, there are certain HTML components, that are either not in ASP.net, or partially different, as well as it being a total pain in the ass to have to do every import, even if it's not as bad as doing it manually.

Edit: I just remembered, asp.net does buttons as "asp:Button," where html is just "input," and an input could be a button, textbox, and other things... So that probably makes it impossible to do automatically.

Hosting ASPNETCore sub-application under ASPNET website

$
0
0

I have 2 applications, let's say it a parent application and child application.
Parent application is developed in ASP.NET MVC 5 targeting to .NET Framework 4.6.2 and is hosted in IIS and running successfully on server.
Child Application is developed in ASPNET Core.
Now, I am trying to host the child application under my parent application. So far I tried, and I am able to host it under parent application. Means, whenever I browse my child application without authenticate, system is redirecting me to the parent application login page. Till here everything is working.

Now after Authentication, when I go to my child application request is not hitting to my application.

Any help will be appreciated.

Thanks in advance.

Anand Neema

deploying from my PC to a production server on my network

$
0
0

hi,

I have written a basic website using VS 2017 ASP.NET and have it running on my PC (locally under Windows 10 etc).

However, I now need to deploy the website to a Windows 2016 server ( running IIS ).

What is the simplest way? Do I need Azure or just a simple web deploy?

My server is hosted in house and as far as I am aware this will not involve Azure?

I have created a simple website on the 2016 server and can browse to the 'hello world' page.

This was created by editing a file on the server.

Is there a full simple guide as to how to deploy from PC to server?

Sorry - I am very new to this. Any guidance much appreciated.

Machine-specific web config

$
0
0

A Tale of Two Developers, both remote.  And a database in-house.

Running Entity Framework against a database remotely is horribly, horribly, horribly, horribly, horribly, horribly, horribly slow.  Certain screens that take 15 seconds to load on-site take 10 minutes plus when the developer is trying to debug.

(remote developer running VS locally, but the database is in-house.  All that data is flying from the server to the desktop over the VPN.)

So.  Developer B and I have backed-up/restored the database to our local machines, BUT if either of us tries to edit Web.Config, Team Foundation Server locks the other one out.

What I'd like to see in web.config is something like this, https://andrewlock.net/how-to-use-machine-specific-configuration-with-asp-net-core/ but for regular old .NETnot core Framework.

Doable?

Issues about change connect database

$
0
0

Hello everybody.
I have a problem to consult with you.
I have changed the connecion string(testdb) in my project to production db using find and replace all for migating the project to production server.

Now when checked old connection is was not existed in the project when i search in the find in files.

There are some crystal reports with dataset inside the project. Hence would like to know
whether the connection string inside the dataset also will change if i use 'replace all' option. or need to change manually.
Thanks for your help.


Visual Studio 2010 Connectivity error with TFS! Owner Showing GUID!

$
0
0

Hi there,

I have to tweak an old VS 2010 solution - pulled form TFS successfully made desired changed and unable to submit changes. I have figured TFS doesn't work with VS 2010, reason being Owner ID turned into a GUID, which should show my actual ID/User Name (Screenshot 1). In Visual Studio 2017 this works fine and show right value (Screenshot 2).

I have googled/Binged with no easy solution - Please help!!!

yes tried tf.exe to update Owner ID doesn't work for 2010 - I can see value is right but VS 2010 grabs only GUID. there must be some patch

Thanks in advance,
-Ahsan

Screenshot 1: Pinterest Link

Screenshot 2: Pinterest Link

 

Could not find file 'D:\Projects\frombackup\CP\CP\bin\roslyn\csc.exe

$
0
0

Hi All,

I am working on MVC5  using EF6.

Sometimes when I run the project it shows error

Could not find file 'D:\Projects\frombackup\CP\CP\bin\roslyn\csc.exe

Sometime it auto corrects but after some times it comes again.

Why this happens.

IP address not resolved from Proxy server

$
0
0
Hello all,

Bear with me - I am not a network person :-)

On our website (hosted on an IIS server) we restrict access to one folder in our web.config file by denying access to everyone, and then specifying IPs that will be granted access. It works well, except when we are up against certain proxy servers used at some academic institutions - when out URL seems not to be resolved by the proxy server (an invalid address error is displayed by the browser using the proxy server).
I don't even know where to start in trying to figure out what's going on.
Anyone with any information would be seriously appreciated.

Mart

How to pass '#' without encoding it to WCF service?

$
0
0

Hello,

I have a WCF service and I'm having an issue while passing a query string with '#' in (_password=...#) this makes the request ignoring the rest of the URL.

I have tried to Rewrite URL Rule but still the same

<rewrite><rules><rule name="rule1"><match url="(.*)" /><conditions><add input="{REQUEST_URI}" pattern="(.*)#(.*)" /></conditions><action type="Redirect" url="{C:1}%23{C:2}" /></rule></rules></rewrite>

I have also added 

<system.net><settings><httpListener unescapeRequestUrl="false"/></settings></system.net>
<uri><schemeSettings><add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/><add name="https" genericUriParserOptions="DontUnescapePathDotsAndSlashes"/></schemeSettings></uri>
<system.web>   <compilation debug="true" targetFramework="4.5"/><httpRuntime requestPathInvalidCharacters="" requestValidationMode="2.0"/> <pages validateRequest="false" controlRenderingCompatibilityVersion="4.0"/></system.web>

But the issue is still remain.

Unable to understand connection string with metadata tag

$
0
0

Hi,

I am trying to troubleshoot an application created by the vendor. I have got this connection string located in the config file and I don't understand how it works.  The thing is, I dont have access to the source code, merely getting the exe to work on a different computer. Right now the exe does not even get launched. 

This is the connection string located at the working pc, I now need to get this up and running on a different pc. What does the metadata mean in the connection string and where can I find the ManrolandModel.csdl., are those files ? I tried searching and I cant search them. 

<add name="ManrolandEntities" connectionString="metadata=res://*/ManrolandModel.csdl|res://*/ManrolandModel.ssdl|res://*/ManrolandModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=Manroland\SQLEXPRESS;initial catalog=GND_Local_Manroland;persist security info=True;user id=XXX;password=XXXX;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Deployment to Windows Server has 2 addresses, one cached one new?

$
0
0

Have an existing site with a windows server host locally, the files are stored in C:/Files/myapp  it has 2 different URLs that map to the same IP and they both map to c:/files/myapp.

But I just uploaded changes, replaced the contents at c:/files/myapp.  the address I used worked.  another person used the other address and said its not working, they are apparently getting some cached/offline version of the file.  But how to set this so the 2 addresses resolve to the same file folder?  or how to dismiss the cache? 

Not sure where to put this, thanks

publishing with vs2019

$
0
0

I made minor changes in my project using asp.net and published in VS2019. I received the following error
4/3/2019 11:52:21 AM
System.AggregateException: One or more errors occurred. ---> System.Exception: Build failed. Check the Output window for more details.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.WebTools.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass43_0.<PublishAsync>b__3()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__183.MoveNext()
---> (Inner Exception #0) System.Exception: Build failed. Check the Output window for more details.<---
I reopened the project in VS2017 and it published with no problem.


web.config file showing error while hosting in godaddy server

$
0
0

i have an web application which has to be hosted on godaddy server.

custom errors mode should be off.. error keeps coming..

the following is web config file

<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime/>
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
</compilers>
</system.codedom>
<appSettings/>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ApplicationInsightsWebTracking"/>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler"/>
</modules>
</system.webServer>

</configuration>

The following is my connection. cs file

public class Connection
{

public SqlConnection getConnection()
{
SqlConnection con = null;
String conString = "server=148.72.232.167;user id=student_db_uname;password=student_db_uname;database=student_db";
try
{
con = new SqlConnection(conString);
}
#pragma warning disable CS0168 // Variable is declared but never used
catch (SqlException ex)
#pragma warning restore CS0168 // Variable is declared but never used
{

}
return con;
}
}

The connection string is what is in godaddy connection..

but still the error persists.. can some one help me.. please

Not Able To Access IIS Web Server Externally

$
0
0

For 4 days, I have been trying to get my IIS web server to work! I am able to access the website internally through the internal static ip address 192.###.#.201 from different devices on the network. I have setup port forwarding on my Verizon router to forward all incoming requests from the external public to the internal port 80 on the Windows 10 desktop where my IIS server is sitting. I have completely turned off all firewall settings and anti-virus applications/processes on my Windows 10. Even after having all those doors being opened, still every time I access the website through the url http://public-ip-address:port# I got the "This site can't be reached" message. I tried it with both IE and Chrome browsers. But none of them work. From the public, I have no problem accessing other web servers connected to the same Verizon router that send and receive communication through port 80. So, clearly there is either something wrong with my Windows 10 or the setup of my IIS server. Or it could be that the router has trouble forwarding the port. I am just guessing. I don't know. It has been 4 days and countless hours, but I am still not able to find any clue to why this is happening. Could someone who has been through similar situation help me out?! Thank you for all of your help!

Java object automation

$
0
0

Hi,

I want to automate java application. 

Below is desktop automation

<div>Desktop Automation using WinAppDriver :</div> <div> </div> <div>1) Git-hub Source Code :- https://github.com/Microsoft/WinAppDriver             [ Tools – UI Recorder]</div> <div>2) WinApp UI Recorder  :- https://blogs.windows.com/buildingapps/2018/06/20/introducing-winappdriver-ui-recorder/ </div><div>3)  https://blogs.windows.com/buildingapps/2018/05/17/announcing-support-for-pen-with-windows-application-driver-v1-1-preview-available-now/</div><div>4) https://blogs.windows.com/buildingapps/2017/10/25/windows-application-driver-no-longer-beta/</div><div> </div> <div></div> <div>i want to do similar to automate java object or java application.</div> <div></div> <div></div>

This operation requires IIS integrated pipeline mode.

$
0
0

When I deploy my ASP.NET MVC application to the host I bought ( it supports ASP.NET 4.7 and MSSQL ) and try to access it with the domain name I get this error:

This operation requires IIS integrated pipeline mode.

Stack trace:

[PlatformNotSupportedException: This operation requires IIS integrated pipeline mode.]
   System.Web.HttpResponse.get_Headers() +11997436
   Microsoft.Owin.Host.SystemWeb.OwinCallContext.CreateEnvironment() +548
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.GetInitialEnvironment(HttpApplication application) +347
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.PrepareInitialContext(HttpApplication application) +19
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.BeginEvent(Object sender, EventArgs e, AsyncCallback cb, Object extradata) +392
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128

Web APP Publish error

$
0
0

Hello,

I am publishing a web app in VS2019, but I am getting the error:

Unrecognized attribute targetFramework.

I have windows 10 with .netframework 4.7 and VS2019.

My project is pointing to .netframework 4.5.

Do you think I need to install framework 4.5 if I already have 4.7?

Viewing all 3561 articles
Browse latest View live


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