viewstate MAC failed in asp.net 2.0 while postback the page - macos

I have a website in asp.net 2.0 with default membership provider. It was fine til yesterday.
When i add custom google search box in my website now i am getting the same error
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
I found few solutions in web that if we installed .net 3.5 with service pack1 then we will get such a errors and either uninstall 3.5 or install service pack 2 with Asp.net 2.0 to resolve the issues.
ASp.net 3.5 was installed in my pc so that i uninstalled it.but no success.
Please advice me a solution to avoid such a problem in asp.net 2.0.

Your custom google search box is a form on the page. You now have two forms and you are only supposed to have one in order to maintain your viewstate.

Related

using IdentityServer4.AccessTokenValidation in a legacy .net 4.6.2 project

I am trying to setup IdentityServer4 to authenticate a webforms project running against .net framework => 4.6.2, a Single page WCF REST application with XML SOAP WCF services as well (also => 4.6.2).
The Single page appliction uses bearer tokens from the client. This works when using then nuget package IdentityServer3.AccessTokenValidation, but restricts the version of IdentityModel to < 2. There is no app builder extension in the IdentityServer4.AccessTokenValidation project and I cant find an example of how to configure this correctly. Is this possible, or am i restricted to using V3 with bearer tokens if my client application is not running dotnet core?
If so how much of a problem would it be in the future not being able to update the IdentityModel package to version 2 and above?
I have been searching into this cant find an obvious solution. Have I missed something simple or misunderstood how i should be using bearer tokens from the oidc js client in OWIN?
The only answers I can find say to use IdentityServer3.AccessTokenValidation instead of 4, but I'm concerned the restriction on the IdentityModel class may cause problems in the future.
Any help would be greatly appreciated.
Thanks
Paul
You can use IdentityServer3.Contrib.AccessTokenValidation NuGet package maintained by the community. This package will use IdentityModel > 3 which should resolve your issues.

How to convert an existing ASP.NET Web API to Azure Mobile Service?

Recently announced at Microsoft Build is the ability to convert an existing ASP.NET Web API to an Azure Mobile Service. I was curious as to if anyone has successfully done this yet, and the steps needed to do so.
Things I've tried thus far:
Added the Azure Mobile Service .NET Backend & Azure Mobile Service -
Entity Framework Nuget Packages to my existing ASP.NET Web API
project.
Resolved an issue with OWIN and AMS(ZUMO) conflicting Startup.cs assemblies.
Ensured the ASP.NET Web API compiles locally, and published as an Azure Mobile Service.
However whenever publishing, it seems I only get a runtime error on the server.
Here was the best example of potentially doing this: http://channel9.msdn.com/Events/Build/2014/3-623
Secondly I've looked a bit into just running the OWIN pipeline via: http://www.strathweb.com/2014/02/running-owin-pipeline-new-net-azure-mobile-services/
I know that this is in a preview mode, but figured some document trail would help!
Can you try adding your existing WebAPI assets to Mobile Services project you create from VS? This will make sure all the right things are wired up. Also, check the Logs tab in the portal for any clues.
This should help..
http://blogs.msdn.com/b/azuremobile/archive/2014/04/10/creating-an-azure-mobile-services-net-backend-from-scratch.aspx
Thanks
Supreet

UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the Salesforce

In windows Phone application, i added Enterprise.wsdl(obtained from my salesforce login id) as reference. I'm able to authenticate using Loginresult. But while using Create the above expense are thrown.
Using SoapHeader class in Web application inherited System.Web.Services.Protocols.SoapHeader so referred the Server url and id.
It is not possible to use web in Windows phone. Plz help if you know any samples to solve it
Part of the results for the login call are a serverUrl, this url should be used to make all subsequent requests, typically in .NET you just set the .Url property of your stub to the provided value. While there are no win-phone specific examples, there are lots of .NET examples in the docs
My experience has been that you can't import the Partner or Enterprise WSDLs to a Windows Phone 7 project.
With Windows Phone 7 projects you can add a Service Reference (for WCF), but not a Web Reference.
Whenever I've imported the Salesforce WSDLs to a standard .NET project I've needed to use a Web Reference to get the APIs working correctly. Something about how WCF doesn't support the Salesforce WSDL defined SOAP headers that are needed to specify the session details.
I found using the REST API and JSON.NET to be the easiest with Windows Phone 7 projects.
That said, my phone app only works with Developer, Enterprise and Unlimited Salesforce editions. Professional and Group editions get the API_DISABLED_FOR_ORG error. I think I need to get the app certified to work with those editions.

How do i get MVC working with Dynamics CRM?

I am using MVC 3 and Dynamics CRM 2011.
IIS 7 on 2008
I placed my app in the ISV folder.
This application works outside of CRM.
My controller name is User, siteurl/user does not work
site/user/index does work
it constantly adds default.aspx to the end of the url. I am running in 4.0 integrated mode.
I have removed the default.aspx entry from default document. Though it's fine to hang out on a standard IIS.
Please I am in so much mental pain.
You won't get it working in a supported way.
The ISV directory is deprecated and should not be used anymore. It was never really ment to host complete web applications. It was meant for small apps which run in the context of Dynamics CRM. Instead use a separate website which connects to Dynamics CRM
Dynamics CRM 2011 has it's own URL-rewriting which extracts the information about the tenant from the requested URI. This will conflict with your app

Exception in brand new Silverlight project

I am getting the following exception message when I try to run my newly created Silverlight app:
An error occurred while trying to make a request to URI 'http://localhost:8732/Design_Time_Addresses/IsAProgrammer.Service/Service1/'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.
This is what I have done. I started with a silverlight app. That created 2 projects. My actual silverlight app and one called MySolutionName.web (not sure what that does except host my silverlight page).
I then made a WCF project so I could have some services for my Silverlight app to consume. I made my services and then added a Service Reference to the silverlight project. I then changed the binding to be basicHttpBinding for my services. (I subsequently refreshed my Service Resource reference in the Silverlight app.)
I reading about this error, I have found that I need a clientaccesspolicy.xml and a CrossDomain.xml file to fix it. I found a generic copy of each of these and added them to both my MySolutionName.Web project and my WCF project.
Any other ideas would be great.
I don't do a lot of WCF myself but it sounds like you've created yourself 2 web applications, one where the Silveright app is host and one service the WCF. Was this intentional?
At a guess I think you should have just added a WCF Service item to the existing host web application.
When u r playing with wcf sevice for the first time with silverlight or wpf these errors are bound to come :). The below link will help you to put your crossdomain policy in right place.
Where to place ClientAccessPolicy.xml for Local WCF Service?

Resources