IIS7.5 Not Compiling Code From App_Code folder - iis

I just recently upgraded to IIS7.5 locally. Our Production system is IIS6.0 (Windows Server 2005). I have a folder setup with an APP_Code folder in production, linked to IIS as a virtual directory. The code compiles fine there. However, my test environment is local (Windows 7 with IIS7.5). The code here will not compile from the APP_Code folder, same folder and virtual directory construction. I do not have a web.config file (using default inheritance). I did not experience these issues until updating to IIS7.5. All files were created in a notepad-like environment (not a project through Microsoft Visual Studio). Any help is appreciated.

My understanding is that IIS7 won't be able to compile files in a APP_CODE directory that is setup as a virtual directory in IIS. Instead, you need to reference files as a subfolder/virtualdir of the APP_CODE directory while keeping the APP_CODE folder a physical directory on the web root. Which would be a better practice anyway, since each website should have its own unique APP_CODE folder anyway. So each website should have a physical /APP_CODE/ directory and in IIS just create new virtual dir in the /APP_CODE directory referencing the folder containing the files you want to be virtual, i.e.- /APP_CODE/VIRTUALDIR/.

Related

Using NuGet for Universal Windows Store App development

I'm trying to use precompiled NuGet packages, like zlib, for WinRT Universal App development. Everything installs and compiles just fine, but running app ends up with "Unable to locate DLL" exception. Apparently, zlib.dll ends up copied into AppX\bin\v120\Win32\Debug\dynamic\cdecl instead of just AppX. If I manually copy .dll to AppX folder, everything works as a charm. What am I doing wrong? How to make .exe load a library in the correct subfolder or make packager copy a .dll into application root folder?

imageresizer vs2012 response code 404

I get an HTTP 404 after installing imageresizer on windows 2008 server r2 x64. I installed the needed packages (e.g. IIS, Visual Studio) and tried to create an project. I didn't knew which type I should choose, so I choosed "empty project". I downloaded imageresizer and copied the needed library files to bin folder. I copied the Web.config in the document root directory. I then created a website with the IIS-manager and pointed the doc root directory to the project directory, where my Web.config lives.
I than started the webserver and tried to access the server using firefox. Anyways, I get an HTTP 404 response code with this request body:
Not Found
HTTP Error 404. The requested resource is not found.
Can anyone help please?
Oh...I missed to copy the Web.config file from the BasicIISExample Application. I'm just getting a warning about adding DiskCache or CDN support. Anyways, its working like a charm now. Awesome software. :)

Package / Publish error on Azure

I've recently upgraded an Azure Project from Azure SDK 1.6 (Visual Studio 2010) to Azure SDK 2.0 (Visual Studio 2012). The project will build with no errors or warnings on the local machine. I can debug on the local machine, but I cannot package or get a build on the build server. The error I get is:
error MSB4057: The target "PipelineTransformPhase" does not exist in the project.
I've confirmed that the C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplications.targets file exists locally and on the build server.
The original project pointed to the \v10.0\ path and I manually changed that to the \v11.0\ path trying to resolve the error with no luck.
I have noticed that when project is not able to access Microsoft.WebApplications.targets file it usually says "The target "PipelineTransformPhase" does not exist in the project."
You need to import Microsoft.WebApplications.targets file into the project. You can do it by adding following line in your project.
<Import Project="C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" />
When importing Microsoft.WebApplication.targets into the project file, make sure you don't set explicit Condition="false". I have seen similar error when Microsoft.WebApplication.targets was imported to the project along with Condition="false".
One more thing to consider when importing Microsoft.WebApplication.targets into project file, always make sure that default variable $(MSBuildExtensionsPath32) is set to "C:\Program Files (x86)\MSBuild\".

Microsoft.SqlServer.Types, Version=11.0.0.0 missing

I have published the project on Azure websites and it throws exception:
Microsoft.SqlServer.Types, Version=11.0.0.0 missing when I try to
run report. Locally everything works fine. I have
RepowrtViewer.WebForms and ReportViewer.Common both version 11.0.0.0
in the project. On the machine locally in SDK/Assemblies
I have Microsoft.SqlServer.Types, Version=11.0..2100.6. I have tried to add this to the project but did not work. The same exception,
Where do I find Microsoft.SqlServer.Types 11.0.0.0?
Thank you
You're probably referencing the DLL's from the global assembly cache on your local machine but they aren't present in the GAC in Azure.
Open up visual studio and right click on the Microsoft.SqlServer.Types assembly reference in your project and select properties. Change the copy local flag from False to True and recompile your application. You should now have the the Microsoft.SqlServer.Types.dll file in your applications bin folder.
Redeploy to azure and hopefully the error will have vanished.
How I got this solved.
I had to add 5 files altogether and I moved these 5 files to my bin directory. I then added these references by browsing to the bin directory and adding them. I rebuilt my project and copied to web server - all working fine.
Microsoft.SqlServer.Types.dll (make sure you copy the correct version as I had sql 2008 but using report viewer 11)
Microsoft.ReportViewer.ProcessingObjectModel.dll
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.WinForms.dll
Also make sure you have the correct version of these dll's from the GAC in the bin directory and I installed report viewer on the server. These are the steps that worked for me.
The best solution would be to install the Microsoft.SqlServer.Types NuGet package.
PM> Install-Package Microsoft.SqlServer.Types
And follow instructions from its readme.htm
I had exactly the same issue but found the solution quite quickly. It was using the Assembly within this folder C:\Program Files (x86)\Microsoft SQL Server\100 where I then removed my reference via Visual Studio and referenced the right file from within this folder C:\Program Files (x86)\Microsoft SQL Server\110
If you still need this reference then please make use of this method.
Cheers,
Check your SQL server ProductVersion using the following query,
SELECT
SERVERPROPERTY('MachineName') AS ComputerName,
SERVERPROPERTY('ServerName') AS InstanceName,
SERVERPROPERTY('Edition') AS Edition,
SERVERPROPERTY('ProductVersion') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel;
GO
It will be like something this,
You can see in my case ProductVersion = 13.0.1601.5. In your project go to NuGet package manager and search Microsoft.SqlServer.Types. From there you can see, Microsoft.SqlServer.Types with the same ProductVersion and Install it.
My Experience
I used to face this kind of problems until I understand the GAC and Bin deploy
Your computer has all the installed DLLs into a place called GAC (Global Assembly Cache). so your local programs can search for their needs in there if they can not find the required DLL in the execution path. It's often work for developer itself, but when you deploy your program to the client, problems may appear.
Remember that, you can always Bin deploy your DLLs. first, go to the references tree in your project and add the required Dll by browsing your GAC (usually c:\windows\assembly\GAC_MSIL...) then go to the property window of the added Dll and set Copy Local to True . Now you can publish or deploy your project and be sure that it will works.
Make sure you are not missing a binding redirect
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0-11.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
https://www.microsoft.com/en-us/download/details.aspx?id=56041
Download from here if this needs to be installed in your machine

deploy java desktop application in netbeans

I create a java desktop application in Netbeans and now I want to deploy to work as software in Linux but I am not very familiar with neat beans I used visual studio and mono to build applications for both Windows and Linux and both of them create your application in bin/release directory and now I want to know what is equivalent to visual studio/mono release in Netbeans.
Thank you
Go to the project folder. Inside that there is a folder named "dist" this contains the jar file. This is the java equivalent of .exe. You need to use that to run on linux(given that JRE is installed on Linux machine). In case of external libraies: the libraries exists in side the "lib" folder which resides inside the "dist" folder.

Resources