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

Visual Studio 2010 - TypeLoadException During Publish

$
0
0

Hi: 

I am having trouble publishing my website...sometime it will publish, sometimes it will not...even without changing anything. 

After Debugging the compile, when the solution publishes, I do not get a TypeLoadException.   When the publish doesn't go through, it is an error on a page that I built.  The error is a TypeLoadException....Cound not load type "MySolutionNameSpace.WebPageClass" from assembly.   The .dll is being built during the publish. 

If I rename the class in the application, it appears to load that assembly fine, and it gives an error on another assembly (on a page that I built).  

I have

      cleaned my .dlls

      my webconfig I set a different tempDirectory each time.  

       I close VS,

       and even Reboot..and no luck.   

During debugging the compile, and I get the error, I viewed the assembly during publish as soon as I get the error and everything in the .dll appears fine....meaing, what it is trying to load is  in the .dll   I am at a standstill. 

I am using Visual Studio 2010 Professional   Version 10.040219.1 SP1Rel    Microsoft .Net Framework Version 4.5.50938 SP1 Rel.  The application runs fine as expected.


cant login to asp.net application after browser close and open on IIS server

$
0
0

I have web application that uses hash login and stored in SQL table.  I then deployed it on IIS server on 2008 R2. 

I can access the application and login fine but when I close browser and try to login to the portal again its keep trying but doesn't login, kind of refreshes and brings me back to login page again. 

if I restart IIS services and try login I am able to but when I close and reopen browser I cant login. I tried different browsers (edge, ie, firefox, chrome) on different machines and getting the same results. 

I am bit lost now where to troubleshoot. is this something on IIS? because once I restart the website I can login, logout and without closing the browser everything works fine. once browser is closed and opened cant login anymore. 

Object reference not set to an instance of an object.

$
0
0

dears

i have this error when i try access my website

i host it on a2hosting.com  .... am not good in technical 

and i get this how can i solve it ?? 

Server Error in '/' Application.


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: 

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: 

[NullReferenceException: Object reference not set to an instance of an object.]
   BVSoftware.Bvc5.Core.Utilities.UrlRewriter.RewritePath(HttpApplication& app, Uri sourceUrl) +319
   BVSoftware.Bvc5.Core.Utilities.UrlRewriter.app_BeginRequest(Object sender, EventArgs e) +72
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

 


Version Information: Microsoft .NET Framework Version:2.0.50727.8762; ASP.NET Version:2.0.50727.8762

Multiple methods all unable to remove response "Server" header / UrlRewrite does nothing

$
0
0

Hey everyone,

I'm having a major issue dealing with response headers on a .Net 2.0 (classic mode) app on Windows Server 2008 R2 under IIS 7.5.  I have been attempting unsuccessfully to remove the "Server" response header from HTTP responses (in order to pass a security validation test from a major client).  I have attempted the following:

- Create a DWORD parameter at "HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\" named "DisableServerHeader" set to 1
- Use UrlRewrite 2.0 to modify the outbound "RESPONSE_Server" response header; here is the web.config xml generated by IIS's UrlRewrite 2.0 wizard:

<outboundRules rewriteBeforeCache="true"><rule name="Remove Server header"><match serverVariable="RESPONSE_SERVER" pattern=".*" /><action type="Rewrite" value="test" /></rule></outboundRules>

   I ensured that I added the "RESPONSE_SERVER" as an "Allowed Server Variable" as well.  I also tried setting this globally for IIS as well, with no luck.

- In addition, UrlRewrite 2.0 just doesn't seem to work AT ALL for any parameter that I try to modify, even a custom parameter that I added on my own
- Finally, I didn't install UrlScan as my research indicated that it only worked up to IIS 7.0 and I'm running 7.5.

Does anyone have any clue as to what I'm doing wrong?  Is there some mystical configuration option that I'm missing?  I can't believe that UrlRewrite isn't working here! 

Thank you for your time

IIS Expres angular2 return HTTP Error 404.0 - Not Found using and identityServer4

Question in using the IP based security control as part of IIS

$
0
0

Before I get started, I will agree that IP-based security is not the best method for security and denying/allowing access on a network, but given my situation, the scope of my project, and the time I have to complete it, it is the quickest method I can implement now, and update later with something else...  That being said...

I was looking into using the IP security control, which can be added to IIS (at least on a Windows Server, not sure about a desktop PC running IIS).

Anyway, I want to check something about setting up the allow/deny permissions.

In the Microsoft help, it says for allowing an IP range, you set the lowest IP address in the range.  Then, you would create a Deny permission and set the lowest IP address in the range that needs to be denied.  If I'm understanding this correctly, so all IP addresses from the lowest one set in the Allow permission setting, all the way up to the IP address set in the Deny permission would be allowed to access the site.  IP addresses beyond that of the one specified for the Deny permission would be denied access.  Is this the correct want to interpret this?  I was hoping that the configuration of allow and deny would be easier, like saying "Allow 192.168.1.1 - 192.168.1.199" and then "Deny 192.168.1.200 - 192.168.255.255".

Can anyone explain how the configuration of Allow/Deny permissions works in IIS's IP based security?  Baiscally, I want to allow all PCs that are in our DHCP scope of our local network to have access to the ASP.NET site, and anyone else outside that range, to be denied access, including our firewall (as we don't want access from the outside), as well as other servers and printers (which have static IPs and are NOT part of the DHCP lease pool anyway).

Value cannot be null. Parameter name: source

$
0
0

Hello,

I'm getting this error deploying a web application in Windows Server 2012 R2 Standard. IIS settings seems to be right in terms of Application Pool (.NET v4.5).

<div style="margin: 0;">Value cannot be null.
Parameter name: source
</div> <div style="margin: 0 0 12pt 0;">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.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: Value cannot be null.
Parameter name: source

Source Error:
</div>
<div style="margin: 0;">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.</div>
<div style="margin: 0 0 12pt 0;">
Stack Trace:
</div>
<div style="margin: 0;"> </div> <div style="margin: 0;">[FaultException`1: Value cannot be null.</div> <div style="margin: 0;">Parameter name: source]</div> <div style="margin: 0;">   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14483202</div> <div style="margin: 0;">   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +622</div> <div style="margin: 0;">   ROMA.FrontEnd.ServiceReference1.IFRONT_END_WCF_SERVICE.GetLoginUserDetail(String email, String password) +0</div><div style="margin: 0;">  ROMA.FrontEnd.Controllers.AccountController.Login(LoginModel model) +198</div> <div style="margin: 0;">  lambda_method(Closure , ControllerBase , Object[] ) +127</div> <div style="margin: 0;">   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +242</div> <div style="margin: 0;">   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39</div> <div style="margin: 0;">   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +12</div> <div style="margin: 0;">   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +139</div> <div style="margin: 0;">   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()+112</div> <div style="margin: 0;">   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()+452</div> <div style="margin: 0;">   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +15</div> <div style="margin: 0;">   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +37</div><div style="margin: 0;">   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241</div><div style="margin: 0;">   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29</div><div style="margin: 0;">   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111</div> <div style="margin: 0;">   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53</div> <div style="margin: 0;">   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19</div> <div style="margin: 0;">   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51</div> <div style="margin: 0;">   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111</div> <div style="margin: 0;">   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+606</div> <div style="margin: 0;">   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)+288</div>
<div style="margin: 0;"> </div> <div style="text-align: center; margin: 0;" align="center">
</div> <div style="margin: 0;">Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34274</div>

I already installed the web application in another Windows Server 2012 R2 Standard without any problem. The application works even in some Virtual Machines where it is installed.

Might you help me on finding and fixing this issue?

Thanks in advance for your help.

Best regards,
Lorens

Which folder to transfer published output to using filezilla?

$
0
0

There was no specification in the .net docs for publishing, and I'm not sure if it matters, because I've transferred the content of the 'published output' folder (copy-pasted all files) into the root folder of my ubuntu server and my application ran without error.  I worry that this isn't the best practice.


I changed password and Got "Server Error in '/' Application".

$
0
0

Hello.

My web portal use MSSQL Server and ASP.net, I changed my portal admin password but when I want logging to my portal via new password then I got:

ServerErrorin'/'Application.RuntimeErrorDescription:An application error occurred on the server.The current custom error settings forthis application prevent the details of the application error from being viewed remotely (for security reasons).It could, however, be viewed by browsers running on the local server machine.Details:To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application.This<customErrors> tag should then have its "mode" attribute set to "Off".<!--Web.ConfigConfigurationFile--><configuration><system.web><customErrors mode="Off"/></system.web></configuration>Notes:The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>

How can I solve it?

Thank you.

debug and publish have different outcome

$
0
0

the nightmare returns for me, please see my previous solved thread: "smtp setup for email from within .aspx instead of config file" 

the problem in that thread to send email vial google was working when I ran program in vs debug, eg, iis express / vs debugger

I'm running IIS 10 and created a localhost site for the project and published the project there via a file system publish profile. the publish was successful and  there is an updated programName.dll in the site's bin directory, so at this point I'm assuming its the 'working' compiled .aspx.vb code that runs in the debugger(yes?) however, I'm getting the same dreaded error "System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at"

so at this point I see 2 possibilities: 1. somehow even though the .dll dates show I'm running the latest and greatest working version from the debugger somehow its the old non working code? or 2. there's some difference in what is actually sent to gmail due it being sent via regular IIS as opposed to IIS express of the debugger?

I am so hoping this won't take a month to solve like the original problem

 

MVC pass value from modal to parent on button click

$
0
0

How do you pass a value from a modal with rendered partial view inside to the parent textboxfor.

textbox from my parent:

@Html.Label("Taxpayer Name")
@Html.TextBoxFor(m => m.taxpayername, new { @id = "search",data_toggle = "modal", data_target = "#myModal", data_backdrop = "static",data_keyboard = "false" })
@Html.ValidationMessageFor(m => m.taxpayername)

modal with the partial view:

<divclass="modal fade"id="myModal"aria-labelledby="myModalLabel"aria-hidden="true"><divclass="modal-dialog"><divclass="modal-content "><divclass="modal-header"><buttontype="button"class="close"data-dismiss="modal"aria-label="Close"><spanaria-hidden="true">&times;</span></button><h4class="modal-title"id="myModalLabel">Modal title</h4></div><divclass="modal-body">
            @{Html.RenderAction("Payer", "Registration");}</div><divclass="modal-footer"><buttontype="button"class="btn btn-default"data-dismiss="modal">Close</button><buttontype="button"class="btn btn-primary">Save changes</button></div></div></div>

The Partial View:

<tableclass="table"id="payer"><thead><tr><th>
            @Html.DisplayName("TITLE")</th><th>
            @Html.DisplayName("NAME")</th><th></th><th></th></tr></thead><tbody>
@foreach (var item in Model) {<tr><td>
        @Html.DisplayFor(modelItem => item.userTitle)</td><td>
        @Html.DisplayFor(modelItem => item.FullName)</td><td>
        @Html.HiddenFor(modelItem => item.userId)</td><td><ahref="@Url.Action("Index","Registration",new { id=item.userId, name=item.FullName });"onclick="SetName();">Select</a></td></tr>
}</tbody></table>

 @section Scripts{
<scripttype="text/javascript"src="~/Scripts/DataTables/dataTables.bootstrap.js"></script><scripttype="text/javascript"src="~/Scripts/DataTables/jquery.dataTables.js"></script><script>$(document).ready(function(){$("#payer").DataTable({});});</script><scripttype="text/javascript">functionSetName(){if(window.opener !=null&&!window.opener.closed){var txtName = window.opener.document.getElementById("search");
        txtName.value = document.getElementById('name').value;}
    window.close();}</script>

whenever i click the select, i was able to retrieve the fullname and id but doesn't populate the textboxfor.

thanks in advance.

Publishing Visual Studio Membership website and DB

$
0
0

 

<div>

Hi

in Visual Studio (2010), I go to File > New Website > ASP.Net Web Site, I view 'Default.aspx' in browser, I register as a new member, this creates ASPNETDB_TMP.MDF in the app data folder (and aspnetdb_log.ldf), and ASPNETDB.MDF in 'Data connections' in the server explorer plus associated folders such as 'Tables' etc.

I've now created a membership site with database, which I can run on my pc.

How do I get that onto my hosting package? I've got sqldb publishing wizard, and sql management studio installed, but I cannot work out how to get it to my hosting, I use websitepanel on an MS platform.

Thanks

</div>

asp. net https - Unable to connect to the remote server

$
0
0

Hello,

I have setup a asp .net web service on cloud. When i try to connect to send HTTP GET over HTTPS, i get following error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 52.17.136.156:443.

Sending the request to HTTP works great. When running the service on my local machine using HTTPS also works. Do i need to configure IIS to support HTTPS?

Using telnet to 80 works. to 443 I receive: "Connecting To 52.17.136.156...Could not open connection to the host, on port 443: Connect failed"

Thanks,

IIS 8.5 404 not seeing application's virtual path

$
0
0

We have an  .NET application on our old server running Server 2008 R2 and IIS 7. It runs as it should under localhost. 

We have copied the code to a new server running Server 2012 and IIS 8.5 and edited the web.config accordingly. All of the same versions of .NET (Core, 3.5, 4.5, etc.) on the old server are on the new server and the app pools, bindings, physical locations are the same on both servers.

I can launch the application in the new server and the home page appears fine. But as soon as I click a link to drill deeper I get:

HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002

The Physical Path is pointing to a path that does not exist as the application should be generating a virtual path. 

We have other .NET applications that are working fine on the new server. 

Any help would be greatly appreciated!

Export to excel with ClosedXML not working after publish to IIS

$
0
0

Hello, 

I have an application that uses the following code to export to excel:

using (var wb = new XLWorkbook())
{
wb.Worksheets.Add(myds);
var fileName = "Report" + DateTime.Today.ToString("dd-MM-yyyy") + "_" + DateTime.Now.Hour +
"-" + DateTime.Now.Minute + "-" + DateTime.Now.Second;
Response.Clear();
Response.Buffer = true;
Response.Charset = "";
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", "attachment;filename=" + fileName + ".xlsx");
using (var MyMemoryStream = new MemoryStream())
{
wb.SaveAs(MyMemoryStream);
MyMemoryStream.WriteTo(Response.OutputStream);
Response.Flush();
Response.End();
}
}

Everything works perfect on my development machine but when I go to Build -> Publish and publish the website to a folder in my machine and then copy the files to the virtual directory on IIS everything works but the Export to excel. When users click on Export the page just blinks and nothing gets downloaded.

I already check on the bin folder of the app and ClosedXML.dll, DocumentFormat.OpenXml.dll and DocumentFormat.OpenXml.xml are in there. What am I missing? 

Any help will be appreciated it

Thanks


mvc automated counter using entity framework

$
0
0

good day. i am making an automated counter using entity framework. the format goes like this

_______________________________________________________________________

||STARTING SERIES || ENDING SERIES || CURRENT SERIES || STATUS ||

||001                      ||     100                ||    001                   ||  FALSE  ||

_______________________________________________________________________

when the page load and status is true, a modal pop up should open so that you could enter a new entry. the starting series is the beginning of the transaction and ending series is the final transaction digit. the current series will be the number that will be printed to a form or receipt and this will be triggered using a button. 

for short, when a user clicks a button, the current series will increment, print a receipt and save to the database. the form will reload with the new incremented value. and when the current series is greater than the ending series, the status will change to true then a modal pop up will show to begin a new transaction.

i was able to able to do the modal pop up but not the incrementing value. Thanks in advance



Best Regards,

Aeon

Querying WMI from ASP.NET application

$
0
0

How do I configure IIS and\or the application pool to allow my ASP .NET application to query WMI?

After testing locally using IIS Express on my Windows 10 dev machine, I have deployed an ASP .NET application to IIS 8.5 on Server 2012 R2.  It is a custom web printing tool running in its own application pool.

I am using Win32_Printer to get details on the printers.  However it keeps crashing wmiprvse.exe.

In the WMI-Activity event log I get:

Id={...};ClientMachine= XXXXX;User= IIS APPPOOL\xxxxxx;ClientProcessId=2856;Component=Unknown;Operation=StartIWbemServices::ExecQuery- root\CIMV2 : SELECT * FROM Win32_Printer WHERE Local=true;ResultCode=0x800706BE;PossibleCause=Unknown

If I login to the server (with my admin account) and use powershell to call Get-WmiObject Win32_Printer I get valid data returned.  After that the ASP .NET application works (at least until server restarts).

Thanks,

Mark

Software & Hardware requirements for ASP.NET MVC application

$
0
0

Hello,

I want to determine the most fit hardware requirements for ASP.NET MVC application that serves 1000 users. Including load balance, web servers and database servers.


Thanks

Decompile Project from Deployment

$
0
0

Hello. I've recently lost all of the project files for a Asp.net project that I had stored on a work server due to some changes that the server team made over the weekend. This means that I don't have an up to date project file for the web application. Is there any way to extract/decompile a solution from the current deployment which is online and operational on Azure? 

I'm understandably in a bit of a panic as a lot of work had gone into the project and I understood it to have been on a server that was full-proof and backed-up on a regular basis. 

Pass key in web.config to add in herf dynamically

$
0
0

Hi all,

I got several Razor page cshtml which having href for popup modals. I got an issue to change herf path manually when deploying them to the server.

I would like to change the href path dynamically.

For example: I want to add server published path /MyApp/Test before to all the following href as follows:

1. In index.cshtml: <a class="btn btn-sm btn-success" data-modal="" href="/Student/View" id="btnView"><span class="glyphicon glyphicon-list"></span>&nbsp;View Student</a>

2. In Create.cshtml

<a class="btn btn-sm btn-success" data-modal="" href="/Student/Create" id="btnCreate"><span class="glyphicon glyphicon-plus"></span>&nbsp;Add Student</a>

3. In Edit.cshtml

<a class="btn btn-sm btn-success" data-modal="" href="/Student/Edit" id="btnEdit"><span class="glyphicon glyphicon-edit"></span>&nbsp;Edit Student</a>

In web.config 

<appSettings><add key="serverPath" value="/MyApp/Test" /></appSettings>

I am not sure how to create key in web.config and pass it to them dynamically. Is it possible to implement that automated process?

Thanks in advance.

Viewing all 3561 articles
Browse latest View live


Latest Images

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