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

IIS Config and VS deployment

$
0
0

`I had a hard drive crash and need to reinstall everything in the Windows 7 dev environment, running Visual Studio 2010 and IIS 7, with .NET 4.x. IIS is configured with Basic and Windows authentication.

When I debug my code in Visual Studio, everything works, but when accessing from the client I get the following error.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS

The code is a backup from prior to HD crash, and it was working just fine. The error shows at SessionState timeout line, but if I remove the line, it will appear elsewhere. The virtual directo4ry is configured.

I have searched around, but not found a solution. Any help would be greatly appreciated.

Thanks.


An unhandled win32 exception occurred in w3wp.exe

$
0
0

Error:
Visual Studio Just-In-Time Debugger
An unhandled win32 exception occurred in w3wp.exe [xxxxx].
(xxxx is process id)

Event Log:

Error
Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7a5f8
Faulting module name: MSVCR80.dll, version: 8.0.50727.6195, time stamp: 0x4dcddbf3
Exception code: 0xc000000d
Fault offset: 0x00008aa0
Faulting process id: 0x2f3c
Faulting application start time: 0x01d2ac5bb8040b06
Faulting application path: C:\Windows\SysWOW64\inetsrv\w3wp.exe
Faulting module path: C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9a\MSVCR80.dll
Report Id: f8bce81f-184e-11e7-9e9d-5065f31c7987

Warn
A process serving application pool 'MyAppPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was 'xxxxx'. The data field contains the error number.IIS Debug Diagnostics Tool 2:

In w3wp__MY_WEBSERVICE___PID__12168__Date__04_19_2017__Time_03_19_30PM__500__First chance exception 0XE06D7363.dmp the assembly instruction atKERNELBASE!RaiseException+58 in C:\Windows\System32\KERNELBASE.dll
This exception originated from msvcr80!_CxxThrowException.
has caused an unknown exception (0xe06d7363) on thread25
This exception originated from msvcr80!_CxxThrowException+46

<div class="groupTitle mt20">

Thread 25 - System ID 8908

</div> <div class="normalText group" id="B1C1Thread8908group"> <div class="mt20 normalText">

Entry point  mscorwks!Thread::intermediateThreadProc
Create time  19/4/2017 15:19:28
Time spent in user mode  0 Days 00:00:00.109
Time spent in kernel mode  0 Days 00:00:00.000

This thread is not fully resolved and may or may not be a problem. Further analysis of these threads may be required.</div> </div>

.NET Call Stack

[[HelperMethodFrame_1OBJ](System.RuntimeTypeHandle._GetTypeByName)] System.RuntimeTypeHandle._GetTypeByName(System.String, Boolean, Boolean, Boolean, System.Threading.StackCrawlMarkByRef, Boolean)
mscorlib_ni!System.RuntimeTypeHandle.GetTypeByName(System.String, Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
mscorlib_ni!System.RuntimeType.PrivateGetType(System.String, Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
mscorlib_ni!System.Type.GetType(System.String)
System_ni!System.CodeDom.Compiler.CompilerInfo.get_IsCodeDomProviderTypeValid()
System_Web_ni!System.Web.Compilation.CompilationUtil.GetRecompilationHash(System.Web.Configuration.CompilationSection)
System_Web_ni!System.Web.Configuration.CompilationSection.get_RecompilationHash()
System_Web_ni!System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate2(System.Web.Compilation.StandardDiskBuildResultCache)
System_Web_ni!System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(System.Web.Compilation.StandardDiskBuildResultCache)
System_Web_ni!System.Web.Compilation.BuildManager.RegularAppRuntimeModeInitialize()
System_Web_ni!System.Web.Compilation.BuildManager.Initialize()
System_Web_ni!System.Web.Compilation.BuildManager.InitializeBuildManager()
System_Web_ni!System.Web.HttpRuntime.HostingInit(System.Web.Hosting.HostingEnvironmentFlags)
System_Web_ni!System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager, System.Web.Hosting.IApplicationHost, System.Web.Configuration.IConfigMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters)
[[GCFrame]]
[[GCFrame]]
[[ContextTransitionFrame]]
[[GCFrame]]
[[GCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[TPMethodFrame](System.Web.Hosting.HostingEnvironment.Initialize)] System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager, System.Web.Hosting.IApplicationHost, System.Web.Configuration.IConfigMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.GetAppDomainWithHostingEnvironment(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.CreateObjectInternal(System.String, System.Type, System.Web.Hosting.IApplicationHost, Boolean, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.AppManagerAppDomainFactory.Create(System.String, System.String)
[[GCFrame]]
[[ComMethodFrame]]


Full Call Stack

KERNELBASE!RaiseException+58
msvcr80!_CxxThrowException+46
mscorwks!AppDomain::BindAssemblySpec+3e4
mscorwks!AssemblySpec::LoadDomainAssembly+114
mscorwks!LoadDomainAssembly+159
mscorwks!TypeName::GetTypeWorker+696
mscorwks!TypeName::GetTypeManaged+1a7
mscorwks!RuntimeTypeHandle::GetTypeByName+de
[[HelperMethodFrame_1OBJ] (System.RuntimeTypeHandle._GetTypeByName)] System.RuntimeTypeHandle._GetTypeByName(System.String, Boolean, Boolean, Boolean, System.Threading.StackCrawlMarkByRef, Boolean)
mscorlib_ni!System.RuntimeTypeHandle.GetTypeByName(System.String, Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
mscorlib_ni!System.RuntimeTypeHandle.GetTypeByName(System.String, Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
mscorlib_ni!System.RuntimeType.PrivateGetType(System.String, Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
mscorlib_ni!System.RuntimeType.PrivateGetType(System.String, Boolean, Boolean, Boolean, System.Threading.StackCrawlMark ByRef)
mscorlib_ni!System.Type.GetType(System.String)
mscorlib_ni!System.Type.GetType(System.String)
System_ni!System.CodeDom.Compiler.CompilerInfo.get_IsCodeDomProviderTypeValid()
System_Web_ni!System.Web.Compilation.CompilationUtil.GetRecompilationHash(System.Web.Configuration.CompilationSection)
System_Web_ni!System.Web.Configuration.CompilationSection.get_RecompilationHash()
System_Web_ni!System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate2(System.Web.Compilation.StandardDiskBuildResultCache)
System_Web_ni!System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(System.Web.Compilation.StandardDiskBuildResultCache)
System_Web_ni!System.Web.Compilation.BuildManager.RegularAppRuntimeModeInitialize()
System_Web_ni!System.Web.Compilation.BuildManager.Initialize()
System_Web_ni!System.Web.Compilation.BuildManager.InitializeBuildManager()
System_Web_ni!System.Web.HttpRuntime.HostingInit(System.Web.Hosting.HostingEnvironmentFlags)
System_Web_ni!System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager, System.Web.Hosting.IApplicationHost, System.Web.Configuration.IConfigMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters)
mscorwks!CallDescrWorker+33
mscorwks!CallDescrWorkerWithHandler+a3
mscorwks!DispatchCallBody+1e
mscorwks!DispatchCallDebuggerWrapper+3d
mscorwks!DispatchCall+b3
mscorwks!CrossDomainChannel::MarshalAndCall_Wrapper+4b7
[[GCFrame]]
[[GCFrame]]
mscorwks!MarshalAndCall_Wrapper2+f
mscorwks!MakeCallWithAppDomainTransition+bc
[[ContextTransitionFrame]]
mscorwks!CrossDomainChannel::MarshalAndCall+7a9
[[GCFrame]]
[[GCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
[[CustomGCFrame]]
mscorwks!CrossDomainChannel::ExecuteCrossDomainCall+7d
mscorwks!CrossDomainChannel::CheckCrossDomainCall+e2
mscorwks!CTPMethodTable::OnCall+a6
0x00bd1805
System_Web_ni!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
[[TPMethodFrame] (System.Web.Hosting.HostingEnvironment.Initialize)] System.Web.Hosting.HostingEnvironment.Initialize(System.Web.Hosting.ApplicationManager, System.Web.Hosting.IApplicationHost, System.Web.Configuration.IConfigMapPathFactory, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.GetAppDomainWithHostingEnvironment(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.GetAppDomainWithHostingEnvironment(System.String, System.Web.Hosting.IApplicationHost, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.CreateObjectInternal(System.String, System.Type, System.Web.Hosting.IApplicationHost, Boolean, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.ApplicationManager.CreateObjectInternal(System.String, System.Type, System.Web.Hosting.IApplicationHost, Boolean, System.Web.Hosting.HostingEnvironmentParameters)
System_Web_ni!System.Web.Hosting.AppManagerAppDomainFactory.Create(System.String, System.String)
System_Web_ni!System.Web.Hosting.AppManagerAppDomainFactory.Create(System.String, System.String)
mscorwks!COMToCLRWorkerBody+1de
mscorwks!COMToCLRWorkerDebuggerWrapper+37
mscorwks!COMToCLRWorker+157
[[GCFrame]]
0x00a6a2be
webengine!GetAppDomain+168
[[ComMethodFrame]]
webengine!HttpCompletion::ProcessRequestInManagedCode+17d
webengine!HttpCompletion::ProcessCompletion+48
webengine!CorThreadPoolWorkitemCallback+1a
mscorwks!UnManagedPerAppDomainTPCount::DispatchWorkItem+9a
mscorwks!ThreadpoolMgr::ExecuteWorkRequest+af
mscorwks!Thread::intermediateThreadProc+49
kernel32!BaseThreadInitThunk+e
ntdll!RtlInitializeExceptionChain+ef
ntdll!RtlInitializeExceptionChain+c2

Descriptions:
My two PC, both windows 7 32-bit and 64-bit sometimes occur this error when my web service my_ws.asmx called by client.

What is the root cause of this error?

Keep .aspx & .cs files on seprate Server

$
0
0

Dear Experts,

I have one confusion, i made .net website code in c# (.aspx & .cs)

Now I have 3 server,

1. Database server - In which i will put my database

2. Application Server

3. Web Server

Now my confusion is, why we need Application Server and Web Server, where i should upload by website source code. what does application server & Web server do?

I spoke to my one of my team mate, he told..i need to upload .aspx file on Web Server & .cs file on Application Server, how is that possible?

Waiting for your quick reply,

Thanks

web.config - Configuration section not allowed to be set below application Error Code 0x80070021

$
0
0

supposedly godaddy did a cache refresh, which I would not think change any basic parms or website setup but now 2 applications don't  run

found this post:

0x80070021
Server Error in Application "application name"

HTTP Error 500.19 – Internal Server Error

HRESULT: 0x80070021

Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.
This problem can occur when the specified portion of the IIS configuration file is locked at a higher configuration level. To resolve this problem, unlock the specified section, or do not use it at that level. For more information on configuration locking, see How to Use Locking in IIS 7.0 Configuration.

I don't know of any config files above my app and I thought when I have specified my app directory as the app root how could there be any higher config files anyway?

unless there is some other problem cause some body can suggest. called godaddy no help there, they are suggesting some how might site is hacked which is really far fetched

sure wish this site had a way to simple attach an image instead of having to use a remote url

How do I run my ASP.NET website on another machine?

$
0
0

I have created a simple website using ASP.NET and C#

It has other packages like bootstrap and jquery installed from NuGet and it also has a SQL Server database (.mdf file.) I have tried copying the solution file and all files under Visual Studio2015/Websites/<project name>/

However, when I open the solution file in visual studio on my friend's laptop, it says some files are missing. I couldn't find the option to export the project as well.

Is there any way I can copy the entire project (including the .mdf file) to my friend's computer so that he can run it in his localhost just as I am running it in mine?

Thanks!

hosting web page error

$
0
0

when hosting a asp.net mvc web app project from iis i am getting a following problems.

HTTP Error 404.8 - Not Found

The request filtering module is configured to deny a path in the URL that contains a hiddenSegment section.

i have done the following steps,

-i have enabled the request filtering in iis security

-i have enable the directory browsing 

but still getting the error,how to rectify it?

deploy asmx web service as https using iis

$
0
0

i have an asmx web service, i am already deployed using iis and i can browse it ashttp.

i have installed a trusted certificate to run it as https but it doesn't  work, it gives me the page cannot be displayed.

any advise please?

virtual application path is defaulting to root

$
0
0

Hi,

 I deployed an application in iis and this contains many virtual applications. if there is any path in virtual application like (../) it is looking in root application but i want it should look in virtual application


ora-03111: break received on communication channel

$
0
0

iam using visual studio 2012 to develop a WCF web service that connects to remote database on another server.

but when trying to call the function; the following error appears:

ora-03111: break received on communication channel

i have tried to use oledb  provider but the same exception appears

any advise please?

Help on 404 custom

$
0
0

"Create a web page (Err404.aspx) with custom error message which will be displayed when a user try to access a non-existing web page"

I created the ERR404.aspx page, now this is code when i add to be web.config file

<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true" />

<!-- Turn on Custom Errors -->
<customErrors mode="On"
defaultRedirect="/nonexistingpage.aspx">
<error statusCode="404" redirect="/Err404.aspx"/>
</customErrors>

</system.web>
</configuration>

Now my end state is to basically test the configuration when the non existing webpage by typing https://localhost/nonexistingpage.aspx

I would appreciate any help on this issues please.

Rickyjj

port 80 is in use

$
0
0

I am trying to run a website application, but every time I run the project I can't load the IISExpress because it says that the port 80 is in use, I run the Tcpview.exe from SysInternals to see who was using the port, but seems not to be in use. I found some related threads saying that can be a problem with the antivirus, I am using Symantec.

here is the properties of the project, as you can see I tried to change the port manually, but it didn't worked

See the picture below

https://ibb.co/nK9h0k

Error on publish does not appear on development

$
0
0

Hi all

i have created html web site now i added some aspx pages all run fine locally

i published on server (godaddy) aspx page give error

This program is blocked by group policy. For more information, contact your system administrator

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.ComponentModel.Win32Exception: This program is blocked by group policy. For more information, contact your system administrator

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:

[Win32Exception (0x80004005): This program is blocked by group policy. For more information, contact your system administrator]

[ExternalException (0x80004005): Cannot execute a program. The command being executed was "G:\PleskVhosts\baptistmedicalcare.net\httpdocs\bin\roslyn\csc.exe" /shared /keepalive:"10" /noconfig  /fullpaths @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a15ee85a\bfcbb773\3tec22cr.cmdline".]
   System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +6978412
   System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine) +115
   System.CodeDom.Compiler.Executor.ExecWaitWithCapture(IntPtr userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName) +81
   Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.Compile(CompilerParameters options, String compilerFullPath, String arguments, String& outputFile, Int32& nativeReturnValue) +193
   Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames) +680
   Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +186
   System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) +24
   System.Web.Compilation.AssemblyBuilder.Compile() +950
   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +10099549
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +10098677
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +294
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
   System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +165
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +43
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
   System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +37
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +339
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
i spent 3 hours with support then they said it is from your page
what could be the problem
(it is running locally)

thank you



How can I lo different levels of trace logs ?

$
0
0

Hi ,

I don’t know if the logging system that has been implemented in  .NET can handle different status of logging.

Is there a setting in the web.config such that I can always log errors ? 

Also can using tracelistener can it handle logging statuses ?

Is there a way to config the web.config file to tell  at what level we are logging at any one time, and setting the default to be Error.

Also I tried to enable error logging with multiple log files by adding the following in the web.config, but i get an error saying that it is not correct .

<system.diagnostics><trace autoflush="true" indentsize="4"><listeners><add name="ErrorsListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\Error.log" traceOutputOptions="DateTime"></add></listeners></trace></system.diagnostics><system.diagnostics><trace autoflush="true"/><sources><source name="TestFileSource"><listeners><remove name="Default"/><add name="TestFileListener"
               type="System.Diagnostics.TextWriterTraceListener"
               initializeData= "TestFile.log"
               traceOutputOptions="DateTime"/></listeners></source></sources></system.diagnostics>

Thanks

 

web.conf for httpruntime

$
0
0

hello guys i have a problem regarding how to remove "X-AspNet-Version" in server response

it tried to put <httpRuntime enableVersionHeader="false"/> on my web config, but it turns out an error

i hope you could help me about my problem thanks and godbless

GIT workflow confusion

$
0
0

Using VS2017 CE.

Worked on a handfull of files in the master branch. Have not done any staging.

Create a branch, check the branch out and stage 2 out of the 5 files, then commit.

Repeat for two other branches and now all changes have been staged and committed.

Now I go back to master branch and merge the branches which works. However I have to know which branches have committed changes that still need to be pushed. Which seems odd.

After I hit SYNC I see the 3 commits I made, plus the three attempts to merge. Odd!

I have not yet pushed.

Is this the way to do things? If not, how can I back track from where I am at?


asp net regiis encryption does not encrypt password with '&'

$
0
0

Hi,

I am using asp net regiis  to encrypt 'appsettings' in web.config  but encryption does not encrypt  key/value  if it's value contains  '&'. If I remove '&' then it works well.

e.g,

<appsettings >

<add key="testuserpassword" value="&+!@47v*k#"/>

</appsettings >

 I am using below commands

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319

aspnet_regiis.exe -pef "appSettings"  <%WebConfigPath%>

I got below error:

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

an error occurred while parsing entity name. Line 73, position 36.

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

Any idea  why asp net regiis encryption does not encrypt password with '&'

Regards,

surya

Windows forms app not connecting with Web Api on IIS

$
0
0

Hi,

I have published a web api on IIS, when I open the URL in the browser, in my case localhost:9420, the web api page appears normally but when I run my Windows forms application ,it won't connect to the api( OnLoad: a combobox is populated with data given from the API which is not happening ). When testing bot the api & the forms application normally from Visual studio without IIS, they both work perfect but if the api is being run on IIS, it doesn't work.

I am also using ApplicationPool .Net 4.5 on the website's IIS Configuration so I don't know why it is not loading the form correctly.

private void LoadCombo() //populate combobox onLoad
        {

            using (var client = new HttpClient())
            {

                using (var response = client.GetAsync(URI).Result)
                {
                    if (response.IsSuccessStatusCode)
                    {
                        var productJsonString = response.Content.ReadAsStringAsync().Result;
                        mowefaatCombo.BeginUpdate();

                        table = JsonConvert.DeserializeObject<DataTable>(productJsonString);
                        for (int i = 0; i < table.Rows.Count; i++)
                        {
                            mowefaatCombo.Items.Add(table.Rows[i].ItemArray[0]);
                        }
                        mowefaatCombo.EndUpdate();

                    }
                }
            }
        }

The error is always on this line: (Object reference not set to an instance of an object.)

  for (int i = 0; i < table.Rows.Count; i++)

Works fine testing through VS but not through IIS as I said. I don't know why it isn't working. Any help? and thanks.

Handler mappings in IIS7 and ASP.NET (VB)

$
0
0

Hi,

I was hoping someone may be able to help. I have an ASP.NET web site running off IIS7. I am trying to implement a custom handler for different extension types (.pdf, .xls, .docx etc...). I have created a new class that implements IHttpHandler and edited the webServer > handlers section of my web.config file. When I attempt to process a .PDF file, the handler works like a charm - same with bitmaps and other files. My problem occurs when I try to process any MS Office documents - The handler class' ProcessRequest event just isn't being hit and the browser goes ahead and attempts to download the file in question. Anyone have any clues as where I may be going wrong?

Here is a snippet from my web.cofig file

<system.webServer><handlers><remove name="OPTIONSVerbHandler" /><remove name="TRACEVerbHandler" /><remove name="ExtensionlessUrlHandler-Integrated-4.0" /><add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /><add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /><add name="WijmoControlsHttpHandler" verb="*" preCondition="integratedMode" path="WijmoControlsResource.axd" type="C1.Web.Wijmo.Controls.WijmoHttpHandler, C1.Web.Wijmo.Controls.4, Version=4.0.20142.176, Culture=neutral, PublicKeyToken=9b75583953471eea" /><add name="PDF" path="*.pdf" verb="*" type="fwCommonWeb.FileProtectionHandler" resourceType="Unspecified" /><add name="XLS" path="*.xls" verb="*" type="fwCommonWeb.FileProtectionHandler" resourceType="Unspecified" /><add name="DOC" path="*.doc" verb="*" type="fwCommonWeb.FileProtectionHandler" resourceType="Unspecified" /></handlers></system.webServer>

Hope someone can help,

Best regards


How to use session.contents as a variable in ASP SQLDataSource Visual Studio 2017

$
0
0

I am using Visual Studio 2017 to build an ASP.NET website (using VB) and have set up a few different connection strings in my web config file for different user types (i.e. basic access, admin access, etc.). Each connection type has access to different rights as well as different schemas in the DB. I'm trying to call these different connections via a session contents variable that is generated at the time of a successful login (on the login page) and then used in other pages on the site.  Depending on the user there's a different connection I want them to utilize within the web config file.  Building the connection strings via the drag and drop on the ASP side and then binding them to drop-downs and grid views is a lot cleaner and easier, however I need to have the the specific connection be variable based on the user. 

This is an example of the ASP connection string used on one of the pages using the connection name from the web config file (DBSource1):

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:DBSource1 %>" SelectCommand="Stored_Proc"
SelectCommandType="StoredProcedure"></asp:SqlDataSource>

Here's the part where I would like to call via session contents to use as a variable in the SQLDataSource:

 ConnectionString="<%$ ConnectionStrings:DBSource1 %>"

Here's the Session content code I'd like to use as a variable:

Session("SqlConstrName").ToString()

I am able to put the session content into a text box in the ASP code and it gives the connection name as it's shown above

ConnectionStrings:DBSource1

I have done some research and know that I cannot use <%= % for server side controls and have been unsuccessful using <%# %, "<%# %", or any other combination type to pass the variable through. I have also tried to bind just the name part and exclude the "ConnectionStrings:" part, but was still unsuccessful.

I know that I can easily create a connection string in my VB code and then bind the data to the objects, but I am attempting to do this on the ASPX side so that my drop-downs, grid-views, etc. stay bound which lowers the amount of VB code needed on the backend and allows me to have more dynamic tables that link between other items on the page without having to write a bunch of on change events. Any suggestions or thoughts is greatly appreciated, thanks!

SMTP eMail Service Issue in AZURE QA Server

$
0
0

Message delivery to the host '<IP address>' failed while delivering to the remote domain 'xyz.com' for the following reason: An SMTP protocol error occurred.

Below is the message from eventvwr. Any guidance to resolve this please !!

<Provider Name="smtpsvc" />

    <EventID Qualifiers="32772">4006</EventID>

    <Level>3</Level>

    <Task>0</Task>

    <Keywords>0x80000000000000</Keywords>

    <TimeCreated SystemTime="2017-05-22T11:42:28.000000000Z" />

    <EventRecordID>144505</EventRecordID>

    <Channel>System</Channel>

    <Data>xyz.com</Data>

    <Data>An SMTP protocol error occurred.

    </Data>

    <Binary>D70204C0</Binary>

  </EventData>

</Event>

Viewing all 3561 articles
Browse latest View live


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