deploying WPF application to IIS: "Deployment and application do not have matching security zones." - wpf

I'm attempting to deploy a WPF application to IIS. After copying the files to the server, when I attempt to download and run the .application file, I get an error:
Application cannot be started, please contact the vendor.
The detailed log shows the error:
Deployment and application do not have matching security zones.
I noticed someone else had a similar problem a while ago.
Can anyone help?

This error was due to me copying the wrong root path up to the web server. I copied the entire "Release" folder to my target URL, but I needed to copy just the app.publish sub-folder.
I encountered a couple more problems on the way:
My deployment included some files in the App_Data folder. IIS7 was blocking this, and I needed to remove "App_Data" from the "Hidden Segments" of "Request Filtering".
I started seeing an error "my.dll already exists in some-random-temp-folder". I just excluded the DLL from my deployment files. I think it had already been marked as "prerequisite".
There's an excellent answer here that provides instructions and some context.

Related

package.json file not found in web application on Azure

We are moving a webforms application, primarily .NET 4.7.2, into Azure. A number of ASPX pages incorporate React sections. All works fine in the current Windows Server environment and running through Visual Studio, but when running in Azure, the package.json file cannot be found even though the file is in the correct location. Information that I've found indicates that this may be due to missing handler mappings. I have found a number of solutions that indicate adding settings in the web.config file may solve the problem:
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json"/>
</staticContent>
However, this makes no difference; a 404 error is still returned.
Our Azure knowledge is minimal, but perhaps it would be better to add the handler mappings in the Azure portal? If this is the case, what should be entered as the script processor?
Any help will be welcome!
If you haven't already tried this, try restarting Visual Studio. Then, from the build menu, hit 'clean solution,' and then 'rebuild solution.'

The existing published deployment does not appear to be a valid deployment manifest

So I was able to publish my wpf application using click once without any problem for a couple of months. But yesterday when I tried I got an odd looking message.
When choosing Yes option the publish stops and fills error list with those errors:
I tried searching online but without any success.
I resolved this issue by unchecking the passive mode check box when prompted for the ftp credentials
This issue started happening to me after I upgraded to Visual Studio 2019 16.7.3. I also updated my application from .NET Framework 4.7.2 to 4.8. (Although I doubt that's the issue, I did not revert to 4.7.2 to test it.)
My solution was to publish to a local folder and then upload those files with a separate FTP application (e.g., FileZilla). Upgrading my existing ClickOnce app worked fine.
Details: In your application's Properties page, select the Publish tab. Change the Publishing Folder Location field from "ftp://whatever" to "C:\publish-MyApp." Click the Publish Now button. VS will create the files pretty quickly. Next, use your FTP application to upload the contents of the C:\publish-MyApp folder to the existing installation folder on your server. This overwrites the existing setup.exe and MyApp.application files and adds a new folder (e.g., MyApp_1.2.3.4) in the Application Files folder.
(One side benefit of this method is that it's faster to publish because FileZilla is a lot faster at uploading than Visual Studio.)

IIS Shared Configuration Webfarm - Error when dynamically updating bindings

First time posting a question so apologies for anything I'm doing wrong.
I have a webfarm of 4 IIS servers running windows server 2016 which uses an azure file storage account for its webfiles. It also save its shared configuration files to the same azure file storage account. This webfarm is then behind an azure load balancer.
Everything works fine, until part of the website code adds an IIS binding. This then causes all the servers to display the error below:
Could not load file or assembly 'EntityFramework,...etc" The parameter
is incorrect. (Image attached for full error).
The only way to resolve this error is to clear the asp.net temporary files from the C drive of all the servers and run IISRESET on each box.
Any ideas?
So this was a mystery but the following changes have resolved the issue. I'm not sure which combination has fixed it, but this might help someone who has a similar issue.
Recreate website in IIS using new App pool.
Removed individual IIS bindings and replaced with wildcard (we had a really old-school system before where we had 100s of binding, maybe one of these was corrupted).
Thanks for your help!

ClickOnce deployment on Windows 10 is not copying an asset folder to the client computer

I recently started having an issue with an Windows Forms application that uses ClickOnce to deploy, in that, when the install completes, it is missing a data folder that contains a zip file and some *.xlxs files needed for the application to run.
This application has been deployed using ClickOnce over numerous updates for the past few years without any real problems. This issue just started happening around the end of December 2017.
I am using VS2017 for the builds. I am using .Net Framework 4.5.2 and I am developing on Windows 10 Enterprise, v1709, build 16299.192
When I publish the application, whether to a local folder on my Dev computer or to the Web Server we use for customer access to download the application; when I look at the published files an I view the Application Files folder, in the folder for the latest version, I can see the Data folder and it has the files as expected.
However, when we run the installer, it doesn't copy that Data folder to the C:\Users{username}\AppData\Local\Apps\2.0\Data\MXTKKEP7.G7K\8W0HCWQ1.AT0\conf..tion_97fe94acfe5f3262_0002.0001_27630dc69b57826e\Data\ location.
When I then run the application, I get this error;
If I manually copy the Data folder to that location, the program runs as expected, without the error.
I get the same problem, whether I click on the *.application file or right-click on the setup.exe file and select "Run as Administrator".
Is this some kind of new security issue because the Data folder has *.zip and *.xlsx files in it?
Has anyone else ran into this kind of problem?
Check include state for you zip and xls files. Goto Publishing project property > Publish > Application Files > And set for you files in publish status column.
If they are missing please check this article:
[To add files to the Application Files Dialog Box]
https://learn.microsoft.com/en-us/visualstudio/deployment/how-to-specify-which-files-are-published-by-clickonce

Installation Error in DotNetNuke

I am new in dotnetNuke. I am trying to install DotNetNuke_Community_05.06.02_Source.zip file.Firstle i extract it to C:\DotNetNuke. There is a release.config file created in C:\DotNetNuke\WebSite\ . Renamed it as we.config. There is another we.config file in C:\DotNetNuke\DotNetNuke_Community_05.06.02_Source\Modules\RazorHost\ renamed it to web1.config. I configured it in IIS6.0 .Created a Database in SQLServer2005 named -DotNetNuke.Changed the connection string as directed by the installation guide. When i am trying to open the installtion wizard through browser it shows an error
Server Error in '/' Application.
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='MachineToApplication'
beyond application level. This error
can be caused by a virtual directory
not being configured as an application
in IIS.
Source Error:
Line 56: Line 57:
Line 58:
validationKey="F9D1A2D3E1D3E2F7B3D9F90FF3965ABDAC304902"
Line 60:
decryptionKey="F9D1A2D3E1D3E2F7B3D9F90FF3965ABDAC304902F8D923AC"
In order to use the source package you must compile the code in release mode before attempting to access the website.
Being new to DNN, I recommend starting with the install package which will not need compiled, or even easier, you can get DNN through the Microsoft Web Platform Installer. WPI will also take care of all the dependnacies that may need configured on your computer.
I'ld like to clarify the intention behind downloading the Source Package. Were you intending to start developing and changing the dotnetnuke framework to suit your needs or did you want to set up a website that you could build modules against on IIS?
If you're intending to develop modules, I'ld suggest downloading the Install Package, creating an IIS site under Default Web Site.
- There's no need to change connection strings if you're using the database file that's in the App_Data folder.
- All you need to do is set the Folder Permissions for Network Service or IIS_IUSRS based on what application pool you're running.
- The url to the site will be http://localhost/xxx.
There are 2 ways to build modules in DNN. The Website Project and the Web Application are two different ways. They produce source code and dll's respectively. If it's internal, any way's good. If it's external facing, you might want a little bit more speed, so go Web Application.
However, If you're intending to muck around with the DNN Core Framework and adjust things, the Source is the way to go. there's no need to adjust the settings, just open the website project up in Visual Studio and away you go.

Resources