473,785 Members | 3,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable to do compilation using CodeDom in ASP.NET

Hi,

I'm trying to use ICodeCompiler.C ompileAssemblyF romSource 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\sys tem32\CSC201E.t mp' -- 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 CompilerParamet ers.TempFiles, but it doesn't work.

Thanks

Jim

Nov 19 '05 #1
2 2046
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
CompilerParamet ers.TempFiles.T empDir to get the temp folder.

-- bruce (sqlwork.com)
<ji****@yahoo.c om> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
Hi,

I'm trying to use ICodeCompiler.C ompileAssemblyF romSource 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\sys tem32\CSC201E.t mp' -- 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 CompilerParamet ers.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 TempFileCollect ion(Path.GetTem pPath()),
but this still doesn't resolve the error.

I even tried to create a temp file for the source code and use
CompileAssembly FromFile, 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
1334
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(); compilerParams.CompilerOptions = "/resource:C:\\InstallProperties.resx /target:winexe" ;
7
10001
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 using CodeDOM for my scripting needs (I realize I could use yacc or something else, but I wanted to try using CodeDOM -- this is more of an exercise for me to learn this stuff). Well, I compile my in-game scripts just fine. See appendix A for my code
1
6484
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 a program to execute. The command being executed was "c:\winnt\microsoft.net\framework\v1.0.3705\vbc.exe"
4
2561
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 can use comma separated values in design-time. The TypeConverter works great in design-time. It converts to and from just fine... However, when I try to load any page in the site now I get the following error (Following the error is code for the...
1
2326
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 Page." After a lot of googling, all i can find that this applies to is when trying to use enum-type datatypes as bit-vector flags, or when use designers to make an expandable property in the property tool-window. However, NEITHer of these...
2
1531
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 "c:\winnt\microsoft.net\framework\v1.1.4322\vbc.exe" @"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\f315a746\1e2bd43d\famzuazo.cmdline".
0
2862
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 sometimes i get the following error. Does anyone knows what i have to do to get rid of this error?
3
8710
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 possible elements expected: 'assemblies, buildProviders, codeSubDirectories, expressionBuilders'. Here's what the web config looks like. The error doesn't cause any issues and according to the MSDN documentation this is valid. So why is VS2005
2
2377
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, (which itself derives from System.Windows.Forms.Form) Whenever I try to open on of these forms in the designer, I get an error, stating it is unable to load one or more of the requested types. (Full text at the bottom of this message)
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.