473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Unable to do compilation using CodeDom in ASP.NET

Hi,

I'm trying to use ICodeCompiler.CompileAssemblyFromSource to compile C#
source code (in a string) into assembly dynamically. This works fine in
a console program, but fails under ASP.NET, the compilation error I got
is CS1619: "Cannot create temporary file
'c:\WINDOWS\system32\CSC201E.tmp' -- Access is denied. "

It seems that the C# compiler tries to create some temp file in my
system32 dir, and ASP.NET's process doesn't have the permission to do
so. So how do I tell C# compiler to use a proper place for temp file? I
tried to set CompilerParameters.TempFiles, but it doesn't work.

Thanks

Jim

Nov 19 '05 #1
2 2030
the vb.net and c# compilers unlike the javascript.net compiler, can not
compile from a string. the compile from string method writes the string to
disk before calling the compiler. it uses the
CompilerParameters.TempFiles.TempDir to get the temp folder.

-- bruce (sqlwork.com)
<ji****@yahoo.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hi,

I'm trying to use ICodeCompiler.CompileAssemblyFromSource to compile C#
source code (in a string) into assembly dynamically. This works fine in
a console program, but fails under ASP.NET, the compilation error I got
is CS1619: "Cannot create temporary file
'c:\WINDOWS\system32\CSC201E.tmp' -- Access is denied. "

It seems that the C# compiler tries to create some temp file in my
system32 dir, and ASP.NET's process doesn't have the permission to do
so. So how do I tell C# compiler to use a proper place for temp file? I
tried to set CompilerParameters.TempFiles, but it doesn't work.

Thanks

Jim

Nov 19 '05 #2
Thanks for the insight, but I don't think this is the case. I have set
compilerParams.TempFiles = new TempFileCollection(Path.GetTempPath()),
but this still doesn't resolve the error.

I even tried to create a temp file for the source code and use
CompileAssemblyFromFile, this doesn't work either.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: shango | last post by:
I am having problem reading from a resource file i've added to a .net assembly. The assembly is compiled using CodeDom. CompilerParameters compilerParams = new CompilerParameters();...
7
by: Clint Herron | last post by:
Howdy! I posted this question on CSharpCorner.com, but then realized I should probably post it on a more active newsgroup. This will be my only cross-post. I'm creating a game engine, and...
1
by: Pardhasaradhy | last post by:
Hi, Please see the following error and revert back as early as possible. I am getting this once I request for the asp.net page. Server Error in '/tanishq' Application. Timed out waiting for...
4
by: Chris Bower | last post by:
Reposted from aspnet.buildingcontrols: Ok, I've got a bunch of derived controls that all have a property Rights of type Rights (Rights is an Enumerator). I wrote a custom TypeConverter so that I...
1
by: A Traveler | last post by:
Hello, i am having this problem. The exact error message is: "Unable to generate code for a value of type 'System.Web.UI.Page'. This error occurred while trying to generate the property value for...
2
by: Steve | last post by:
Hi I'm receiving the following error whenever a new build is placed onto our production server: Timed out waiting for a program to execute. The command being executed was...
0
by: Marco Viana | last post by:
Hi, I'm developing an ASP.NET application with Visual Studio .NET 2003 in a Win XP Professional, .NET Framework 1.1 and IIS 5.1 computer with all the lattest patches. When testing a page...
3
by: Robert | last post by:
I have a number of web projects converted from 1.1 to 2.0 in VS2005. I am methodically seeing the error below: The element 'compilation' has invalid child element 'compilers'. List of...
2
by: Paul Cheetham | last post by:
Hi, I have moved an application from VS2003 to VS2005, and I am now unable to view most of my forms in the designer. The majority of the forms in my project are derived from class PACForm,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.