rdlc could not be found in published project by oneClick - c#

I have programed an application in visual studio and ithas reports of report Viewer(rdlc)it workes fine on development machine, but when I deploy it on server (IIS 6) ,the program won't run and fails, what it says : downloading report.rdlc did not succeed .The remote server returned an error: (404) Not Found.. the file exist in the "application files" folder in published application.
what I have done is that:
1-in the report file the build action is "Content" and it always copy
2-in the server I add a Mapping for the rdls extention to aspnet.isapi.dll location
3- in the application files of publishing it is set to "Include(Auto)"
what else can I do to run the application with rdlc?

These are what I have done to solve the problem:
in Publish page of project properties, in the prerequisites , I checked the Microsoft Visual studio 2010 Report Viewer
in the Application Files page of project properties, I changed the publish Status to "Include" of the following files
a) Microsoft.ReportViewer.Common.dll
b) Microsoft.ReportViewer.DataVisualization.dll
c) Microsoft.ReportViewer.ProcessingObjectModel.dll
d) Microsoft.ReportViewer.WinForm.dll
I checked the value of "Use .deploy file extenstion" in following Path
Properties of Project => Publish => Options => Deployment
These changes solved my Problem.

Related

ASP.NET MVC: 500 server internal error

I have deployed my application to server as below (from here):
To deploy an ASP.NET MVC application
In Visual Studio, open the project that you want to deploy.
In Solution Explorer, expand the References node.
Select the following assemblies:
System.Web.Mvc
System.Web.Routing
System.Web.Abstractions
In the Properties window, set Copy Local to True.
In Solution Explorer, right-click the project and click Publish. The Publish Web dialog box is displayed.
In Target location (http:, ftp:, or disk path), browse to a local folder and click Open.
Select either Replace matching files with local copies or Delete all existing files prior to publish.
Under Copy, select one of the following, depending on your needs: Only files needed to run this application, All project files, or All files in the source project folder.
If your application contains files in the App_Data folder such as database files, select Include files from the App_Data folder.
Click Publish. All the files that are required in order to deploy the application are copied to the target folder.
Afterward I have errors connecting database which was about loging failure which fixed. Then I face 500 internal server error.
I tried to enable debugging options and show errors which did not worked(here are the details).
I tried to do some blind tries, e.g. I created a control/view which its view just simply display an static output without any logic however it is still have 500 error.
I don't know how to fix this and how to continue debugging this project. What can I do know?

Non-Azure Deployment through VS 2015 RC

I'm trying out ASP.NET 5 and all its new features on VS 2015 Enterprise RC. To ensure smooth end-to-end deployment, I then try to deploy the application to a non-Azure private server through VS Publish feature.
However, I'm missing out a very important feature: the ability to publish to a non-Azure server.
In earlier versions of Visual Studio (I'm using VS 2013), the Custom options is there.
I've tried tinkering with the Project Properties but nothing on how to deploy my ASP.NET 5 app to a custom server. Any ideas?
It's doable (after all, publishing to Azure websites also uses WebDeploy internally), but it's kinda tricky right now and requires you to tweak a few things.
Here's what you can do (for VS 2015 CTP6):
Preparation
Asp.net vnext has slightly different directory structure than a regular Asp.net app. The are two main directories: approot and wwwroot (if you deploy the application to local filesystem, you can browse through them). We want to deploy both those dirs, but the IIS website path has to point to wwwroot dir. This problem seems to be addressed in Web Deploy 3.6, but i will just deal with it manually. In order for this to work, you can create two websites/applications in IIS:
one that points to the root application dir and will be used just for deployment. I will name it mysite-deploy.
one that will be used to actually host our website and will point to wwwroot dir. I will name it simply mysite.
Deployment
Go to YourprojectDir\Properties\PublishProfiles
Create an empty pubxml file (i.e. mysite.pubxml)
Paste the following content into your pubxml:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
</PropertyGroup>
</Project>
When You press "Publish" in Visual Studio, you should see this new profile on the list.
Fill out the Connection tab, as you would normally do (set Server, Site Name, etc.). Remember to set Site Name to the deployment site (mysite-deploy).
Validate Connection
Try the preview tab - it most probably wouldn't work, but in case it does - you're done.
Click Publish
Check progress in the Web Publish Activity window.
Possible errors
Out of the box, the publish will probably fail. Now it gets tricky :)
ERROR_FAILED_TO_DESERIALIZE
At first, what I've got is this error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.AspNet.Publishing.targets(205,5): Error ERROR_FAILED_TO_DESERIALIZE: Web deployment task failed. ()
Publish failed to deploy.
Let's try to fix that.
Open the Publish window again, and check Publish using Powershell script option on the Settings tab.
Try again.
ERROR_CERTIFICATE_VALIDATION_FAILED
If you get an error: ERROR_CERTIFICATE_VALIDATION_FAILED, this means that the SSL certificate that IIS Management Service on your target machine is not trusted by your computer. You can try to download the certificate add it to trusted cert store, or you can disable certificate validation altogether.
In the latter case, you need to edit publish-module.psm1 located at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Scripts\1.0.0-pre\publish-module.psm1. Find the fragment:
# add excludes
$sharedArgs.ExtraArgs += (GetInternal-ExcludeFilesArg -publishProperties $publishProperties)
# add replacements
$sharedArgs.ExtraArgs += (GetInternal-ReplacementsMSDeployArgs -publishProperties $publishProperties)
And add this:
$sharedArgs.ExtraArgs += '-allowUntrusted'
ERROR_COULD_NOT_CONNECT_TO_REMOTESVC
Inspect the exact commandline that is getting invoked - in Web Publish Activity Window there should be a line logged, starting with Calling msdeploy with the command:. Look for ComputerName=. If it looks like this: ComputerName='https://https://myhost:8172/msdeploy.axd'/msdeploy.axd', then you should changeServerfield in Publish profileConnectiontab to:myhost:8172. That's because the powershell script automatically addshttps://and/msdeploy.axd`.
ERROR_PROVIDER_NOT_FOUND
More Information: The provider 'contentPathLib' could not be found. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_PROVIDER_NOT_FOUND.
Go again to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Scripts\1.0.0-pre\publish-module.psm1 and find the line:
$publishArgs += '-enableLink:contentLibExtension'
This seems to be a feature of Web Deploy 3.6, but it seems that the server side has to support it also. To disable it, just comment out this line. Warning: This change may impact powershell deployment to Azure websites.
Only the content of wwwroot directory gets deployed
Now that your site is being deployed, there is one more thing. We wanted to deploy approot and wwwroot directory, and instead only the content of the wwwroot directory is deployed. To fix that, we need to once again edit C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Scripts\1.0.0-pre\publish-module.psm1.
Find the line that says:
$webrootOutputFolder = (get-item (Join-Path $packOutput $webroot)).FullName
And after that, add a new line:
$webrootOutputFolder = $webrootOutputFolder | split-path -parent
This will set the published folder to the parent of wwwroot, which is exactly what we need. Before publishing again, you may want to clear your site's directory on the server - the published directory structure will be different now.
Testing
At this point, the site should be deployed and available on the server. On the server side, you should see two directories: approot and wwwroot and maybe some script files.
Any server side errors you will have to debug yourself.

Visual Studio SetUp Project -- How to package .rpt files for my application to be installed along with the main app

I am new to Crystal reports installing. I have an application that contains Crystal reports *rpt files. I have a setUp project that correctly builds *.msi file that install the dlls and exe files for my application but currently does not package the *.rpt files as well. How do I set this up to copy the *.rpt files and copy them to a folder local to the install? I would like to even specify the particular path on the local machine the *.rpt files should be copied to. How do I do this please?
Thanks in advance.
I was able to solve this problem in my project setup project.
a) Open your project setup Project in Visual Studio.
b) Right click the project, and select View > File System
c) Right click the Application Folder (in left panel of the File System window, right under File System on Target Machine node in menu), and select Add> Folder
d) Add the name of the Folder where you want your reports to be installed on the client machine, in my case, my folder was name REPORTS
e) Add copy of your *.rpt files from your application to the folder you just created in your set up project
f) Build your setup project, and when installed, a reports folder will be created and the copy of your report files will be included in that folder.

I try to run some samples in VS

Error 1 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. C:\Users\rzv\Desktop\WebSamples\Backup\WebSamples\Web.config 49
when I try to run http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx in VS 2010. What's wrong and why do I get IIS error when I run something in VS?
Edit
When you convert a project from VS 2008 to VS 2010, it creates a folder /backup/ inside of the application. When you run the project, it is trying to run the project and the subfolder /backup/, which contains a web.config file. Move the /backup/ folder to another location and it should work.
In general, you can't run an application from a subfolder of another application if it uses application-level settings in its configuration file web.config.

Crystal Reports for Visual Studio 2010 Error

I am trying to run a crystal report from my web application which was built using ASP.NET 4.0 and Visual Studio 2010. I have installed the following from the SAP site (http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp)
1) SAP Crystal Reports, version for Visual Studio 2010 - Standard EXE installation package which installs the software into the Visual Studio IDE.
2) SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit)
I have a page called Reports.aspx in which I have a crystal report viewer control
<CR:CrystalReportViewer ID="rptViewer" runat="server" AutoDataBind="true" />
In the Reports.aspx.cs file I have the following code:
protected override void OnPreRender(EventArgs e)
{
ReportDocument report = new ReportDocument();
var path = Server.MapPath("Reports/Sample.rpt");
report.Load(path);
report.SetDatabaseLogon("username", "password", "servername", "databasename");
rptViewer.ReportSource = report;
}
On the report.Load(path) line I get the following error:
Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.
How can I fix this?
I also got into the same problem my problem was report path was not valid, May be you have same problem , check Server.MapPath("Reports/Sample.rpt") returning valid path ?
make sure the report is in app_code folder
initialize a new instance of it instead of initializing a reportdocument and loading the report in it.
Sample report = new Sample();
this worked for me
You will need to modify two properties in the .rpt files:
Build Action is set to "Embedded Resource" by default. Change it to "Content".
Copy to Output is set to "Do not copy" by default. Change it to "Copy always".
Rebuild, Build deployment package and Publish. Done!
NOTE: Below, the term "WebSite" refers to actual web site nodes in IIS, NOT a virtual directory within a web site.
Problem Root Cause: There is no "aspnet_client" folder accessible by the application.
This can happen for several reasons:
Since the SAP CR installer appears to install the aspnet_client folder in the ...\inetpub\wwwroot\ folder, if your Web Site physical path is NOT ...\inetpub\wwwroot, your application will not have access to the aspnet_client folder.
If the aspnet_client folder was moved or deleted from to the top level of your web site's physical path, your IIS application will not have access to the folder.
Problem Solution (For Windows Server 2008 R2)
Go to the IIS manager on your server
Expand the tree view node for the WebSite running your application
Look at the level immediately under the web site node and ensure you see a "aspnet_client" folder.
If you do see the folder, then perhaps this root cause is not the cause of your problem.
If you do NOT see the folder, search the server's hard drive for it and COPY it to the Web Site's Physical path.
Right mouse button click on the Web Site node and click Refresh from the popup Menu
You should now see the aspnet_client folder at the level directly under your web site node and the reports in the application should work.
I ran into this when I converted a web site to a web application. The report would run fine on my dev machine, but not on the server. Then I realized the rpt file was missing on the server!
By default the report files were considered embedded resources and were not copied when the web application was published. I just changed them individually, republished the site, and all was well again.
I have also had a report load failure if I have mistakenly left the report file open in crystal reports designer.
This error is a real treat, and seems to have many possible antecedents. Fortunately I only wasted a day on my particular variation:
ReportDocument.Load() also makes a local temp copy. (This may only be in the case of a load from a network drive location, I didn't test this in the case of a local load.)
If the user context under which the load occurs does not have authority to create the temp file locally, Load will fail with the same very unhelpful error.
Also, I ended up diagnosing this with Process Monitor. It may be helpful for you as well.
Please make sure your report rpt files are in their original folder. I got the same error first, after I "published" my MVC web site to IIS. I didn't realize that "Publish" didn't put rpt files in the package.
Re-install the "Crystal report engine" to the server
Build Action set to "Content".
It perfectly worked for me..!

Categories